Originally posted by sura watthana:
answer to question 2: this code will fail to compile since void cannot be at constructor.
answer to question 3: this code will fail to compile since class TurboTurtle does not know which interface the Race() method it is referring to.
Ask a Meaningful Question and HowToAskQuestionsOnJavaRanch
Getting someone to think and try something out is much more useful than just telling them the answer.
+nav
Originally posted by Nanda Kishore:
Question - 3 will compile after removing the extra }. But it will not run. It will throw NoSuchMethodError.
Ask a Meaningful Question and HowToAskQuestionsOnJavaRanch
Getting someone to think and try something out is much more useful than just telling them the answer.
Regards,<br />Mani<br />SCJP 1.4 (95%)<br />SCWCD 1.4 (94%)
Kapil Munjal
SCJP 1.4, SCWCD 1.4
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.
Mike Gershman
SCJP 1.4, SCWCD in process
Politics n. Poly "many" + ticks "blood sucking insects". Tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
|