Animal myAnimal = new Animal();
I have this code above. As far as I know, it will do these things :
When an object is created, java does not share its Actual Memory Address with refrence variables instead of that Java creates an index number for your object,which is passed to the reference variable of that object. So, you are able to access your object with help of that index number. Further your object hold the refrences of its children and help you to access them.