Last week, we had the author of TDD for a Shopping Website LiveProject. Friday at 11am Ranch time, Steven Solomon will be hosting a live TDD session just for us. See for the agenda and registration link
"Any fool can write code that a computer can understand. Good programmers write code that humans can understand." --- Martin Fowler
Please correct my English.
the output is
Exception in thread "main" java.lang.AssertionError
i know that error can't be handle by exception handler. but what i understand from output that the assertionerror is an exception
that means that it is may be a child for excepton class so why catch clause fails to handle.
and also ....at the same time i wondered why it cause an excption not an error
SCJP Pass 85%....
Thousands of candles can be lighted from a single candle, and the life of the candle will not be shortened
"Any fool can write code that a computer can understand. Good programmers write code that humans can understand." --- Martin Fowler
Please correct my English.
Saying specifically it will be an Error not throwable. But because throwable is parent of both Error and Exception so in case of both you can say that if is a throwable but actually it will be Error or Exception.
Error and RuntimeException are unchecked exceptions so the compiler doesn't care whether you catch them, declare them or ignore them. Changing line 15 on your code to say (Error e) will bear out what Wouter has said.
Rajeev Trikha (SCJP 6)
Blueberry pie is best when it is firm and you can hold in your hand. Smell it. And smell this tiny ad:
Free, earth friendly heat - from the CodeRanch trailboss