Given two classes, one subclasses the other, both out of my scope, so I don't have any influence on them, eg.
public class Bla {
}
public class SubBla extends Bla {
}
How can I create a customized subclass of Bla and SubBla without repeating code or limit SubBla's special functionalities?
Edit: So I don't have to:
public class MyBla extends Bla {
public void someOverriddenMethodOfBla()
{
super.someOverriddenMethodOfBla();
// do something custom
}
}
public class MySubBla extends SubBla {
// repeated code: this should do the same as MyBla's customized method
public void someOverriddenMethodOfBla()
{
super.someOverriddenMethodOfBla();
// do the same custom stuff as in MyBla's method
}
}
Edit 2, to clear things up a litte:
Let's say I need the android classes Activity and ListActivity, which is a subclass of Activity. Now I want to add the same customization in the onCreate method to both. How do I acomplish this without repeating code?
Thanks!