I have a class:
class MyClass {
public MyClass getParent() { ... }
public MyClass[] getChildren() { ... }
....
}
and a subclass
Maybe using generics (http://docs.oracle.com/javase/tutorial/extra/generics/index.html)
You should have something like this:
public class MyClass {
public T getParent() { return null; }
public MyClass[] getChildren() {
return null;
}
public static void main(String[] args) {
MyClass o = new MySubClass();
o.getParent().getId();
}
}
class MySubClass extends MyClass {
public String getId() {
return "";
}
}