“I bought this guide a few days ago to prepare for my interview with Oracle. Many of the questions they asked me were from this guide. I found this book absolutely great!”
Since C is the base class, it can’t be casted to A. Class cast exception will happen. If I cast A to C and then call foo(), the a.foo() will only get executed.
Bala,
I think you are wrong … we have
Class A
Leave an Answer/Comment