Hi all, This is reference from chapter 5 Kathy and Bert book pg 325. Look at the code below.
The explanation given in the book says that some compiler might give error and sometime JVM could throw StackOverFlowError. I tried this code and I am getting compile time error saying "recursive constructor invocation".
My question is what should we select in the exam if we have both the options a) Compile time error b) Run-time error.
Any thoughts/suggestions ?
Cheers,<br />Jay<br /> <br />(SCJP 1.4)<br />Heights of great men were not achieved in one day, they were toiling day and night while their companions slept.
You may see this as punting, but I really wouldn't worry about this question on the exam. Questions on the exam are very well tested and unambiguous. If the book gives you a question with "sometimes the answer is this... and sometimes the answer is that... " answer, the question won't be on the exam.
As a programmer, you should simply know and understand that the situation depicted in the question is something you don't want to do.