OCPJP 6
"Any fool can write code that a computer can understand. Good programmers write code that humans can understand." --- Martin Fowler
Please correct my English.
OCPJP 6
Daddaoua marouan wrote:
C. Some, but not all, will compile
D. All of those that compile will throw an exception at runtime
Answer:
C and D are correct.
OCPJP6
Daddaoua marouan wrote:
whene the overrided method doesn't throw ANY Exception AT ALL we assume that it throws RunTimeException ... is my logic correct ?! thus the overridING method should throw only RunTimeException or one of its kids !! please say yes !
and thank you
OCPJP6
OCPJP 6
OCPJP 6
Daddaoua marouan wrote:
the overridING method should throw only RunTimeException or one of its kids
OCPJP6
Daddaoua marouan wrote:
whene the overrided method doesn't throw ANY Exception AT ALL we assume that it throws RunTimeException
OCPJP6
Daddaoua marouan wrote:no no ... a Devision slash "/" was removed .. while copying from the pdf i guess
it should be like this
so D is correct , it will produce "/ by zero " ArithmeticException exception
sharp mind though![]()
thank you
OCPJP6
OCPJP 6
Daddaoua marouan wrote:Now i totally GET IT ... thank you so much Trivikram AND Wouter Oet for your time and your well explanation
Daddaoua marouan wrote:did you finish the book or not yet ? if yes how long did it take
Daddaoua marouan wrote:10 days and i'm already at chapter 6 !!!
OCPJP6
OCPJP 6
Wouter Oet wrote:
Option 2 does not compile because MyException is an Exception and not a RuntimeException. Thus it's throwing a larger Exception than the parent class which is illegal.
OCPJP 6, OCMJD
I’m tired of walking, and will rest for a minute and grow some wheels. This is the promise of this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
|