posted 20 years ago
A. It is never good practice to place assertions where you think execution should never reach.
FALSE - it�s a GOOD practice to place assertions (IN DESIGN FASE) where you think execution should never reach.
E. Don't handle AssertionErrors with a try-catch block.
FALSE - AssertionErrors should never be handled
The other statements:
B. It is never good practice to throw an AssertionError explicitly
CORRECT - it is sometimes advisable to thrown an assertion error even if assertions have been disabled
C. Use assertions to verify the arguments of private methods.
CORRECT - for private methods is ok, but don�t use in PUBLIC methods
D. Don't use assertions to verify the arguments of public methods.
CORRECT - see above
Time is an excellent teacher; but eventually it kills all its students. <br /> <br />Alexandre Mottin Ferras<br />SCJP 1.5 <br />SCJP 1.4<br />SCWCD 1.3<br />SCBCD<br />IBM Object-Oriented Analysis and Design with UML