Let's say I have the following class :
public class ParentClass{}
And one of its children classes is :
public class ChildClass extends ParentClass{}
Let's consider another class :
public class Foo{
private ParentClass field;
public Foo(){
field = new ChildClass();
}
public static void main(String[] args){
Foo foo = new Foo();
}
}
When drawing the Object Diagram of foo
I don't know if I have to write ChildClass
:
Or ParentClass
: