SCJP 6
SCJP 6 (88%), SCWCD (89%)
SCJP 6
ujjawal rohra wrote:Nice Explanation but i want to know that the master exam question which i quoited is the right answer or not..
Please let me know
should be true. Please check the errata for K&B book if this is there"Never throw an assertion error explicitly"
SCJP6, SCWCD5, OCP-JBCD5, OCE-JWSD6 OCE-JPAD6 , OCM-JEA5 1,OCM-JEA5 2,3,OCJP8 - Brainbench certifications: J2EE, Java2, Java2-NonGUI, JSP, SQL2000 Admin, SQL2000 Programming , Brainbench certified Java Programmer, Computer Programmer, Web Developer, Database Administrator
Rajeev Rnair wrote:
should be true."Never throw an assertion error explicitly"
No. it is not . you can validate and still throw an AssertionError from *private* method which is not directly called by a client.
but it is not a good idea to throw that(AssertionError which is not understand by user/client) from public method
hth
SCJP6, SCWCD5, OCP-JBCD5, OCE-JWSD6 OCE-JPAD6 , OCM-JEA5 1,OCM-JEA5 2,3,OCJP8 - Brainbench certifications: J2EE, Java2, Java2-NonGUI, JSP, SQL2000 Admin, SQL2000 Programming , Brainbench certified Java Programmer, Computer Programmer, Web Developer, Database Administrator
SCJP6, SCWCD5, OCP-JBCD5, OCE-JWSD6 OCE-JPAD6 , OCM-JEA5 1,OCM-JEA5 2,3,OCJP8 - Brainbench certifications: J2EE, Java2, Java2-NonGUI, JSP, SQL2000 Admin, SQL2000 Programming , Brainbench certified Java Programmer, Computer Programmer, Web Developer, Database Administrator
Thrown to indicate that an assertion has failed.
Spot false dilemmas now, ask me how!
(If you're not on the edge, you're taking up too much room.)
Which are true? (Choose all that apply.)
A It is not good practice to place assertions where you think execution should never reach.
B It is sometimes appropriateto call getters and setters from assertions.
C Use assertions to verify the arguments of private methods.
D Assertions can be disabled for a particular class.
E Never throw an AssertionError explicitly.
E is also incorrect.
Ryan Slominski wrote:I also think E should be a correct answer.
OCPJP 6.
In Your Pursuit Towards Certification, NEVER Give Up.
Dennis Deems wrote:It's a very poorly constructed question. Only three of the choices (A, B and D) are assertive statements which can be true or false. The other two, C and E, are imperatives which can be neither true nor false, in exactly the same way that the command "open the door" can be neither true nor false. It surprises and disheartens me to encounter this kind of error.
OCPJP 6.
In Your Pursuit Towards Certification, NEVER Give Up.
Ikpefua Jacob-Obinyan wrote:why do you think E should be a correct answer
Dennis Deems wrote:C and E, are imperatives which can be neither true nor false
A tiny monkey bit me and I got tiny ads:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
|