Today i was interviewed and didnt get selected, however i took this interview as a learning curve for myself. One of the tricker question being asked to me at the interview was "In an abstract class, do you have a constructor ? If yes, since we cannot instantiate Abstract class, wont that code be unreachable?"
I got confused at that question and when i came home and researched, I came to know that Every class including abstract class does have a constructor and its called when the Object of its implementation class is created. So for testing this out, I wrote a small code to verify my understanding.
Here's what i coded :
Implementation Class : YNJTest.java
Understand was correct, however my code landed in a problem and here's the output...