Can someone explain why c is not true ? What is the meaning of statement B ? Which statement is true? A. Assertions can be enabled or disabled on a class-by-class basis. B. Conditional compilation is used to allow tested classes to run at full speed. C. Assertions are appropriate for checking the validity of arguments in a method. D. The programmer can choose to execute a return statement or to throw an exception if an assertion fails.
C is not true because assertions are only used to validate parameters of PRIVATE methods. Parameters of PUBLIC methods should be validate returning an exception.
A is effectively true because we can decide to enable or disable assertions class by class, package by package, ...
Hope it helps !
Oli,<br />SCJP
Beware the other head of science - it bites! Nibble on this message: