IT took me a while before I managed to figure out the problem. What the question is basically trying to prove is that when you have a subclass that is referenced by a base class reference, you must downcast, *unless* that method exists in the baseclass, and then
Java will downcast for you.
Here is what I came up with:
In Grandfather.java:
In Father.java:
And in Driver.java:
If you save and compile each of these files, and then run Driver, you will see '1' output on the command line.
If you then uncomment the single method declaration in Grandfather, and switch the System.out.println's in Driver, and recompile everything, you will also see '1'.
Does that help?