If a Father is a Parent and a Parent is a Person and a Person has a Father I create the following:
class Person{
Father father;
}
class Parent extends Person{}
class Father extends Parent{}
Instances:
Person p1 = new Person();
Person p2 = new Person();
p1.father = p2; //father is of the type Father
This doesn't work... Now try casting::
Person p1 = new Person();
Person p2 = new Person();
p1.father = (Father)p2;
This doesn't work either.
What does work for this case?