I answered B and C, but the correct answers are A and B.
I approached this kind of question with applying instanceof
test.
here is my approach...
So, my own answers, for B, dog2 is an object of Beagle(), cast to Beagle, Beagle() is an instanceof Beagle, so CORRECT.
For C, dog2 is of object Beagle(), is an instanceof Beagle, so it is true to be assigned to a Beagle ref.
What is wrong with my approach? please guide!