This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
Hi Megha, Don't skip assertions. It is an easy topic and very easy to score in assertion questions. you will get two or three questions in this topic. May be less but don't skip this topic. You won't need more than half an hour to get a good idea of assertions. To get a good score each question counts so don't skip anything. Sanyev
Joined: Mar 10, 2004
Thx for the reply. I will cover that topic and try to cover other topic also.
I am planning to give the exam next week, so is there any quick revision notes which i can go thru. K&B book 2 minute drill is very good and i will go thru that but is there something else also.
An assert statement can take any of the two forms below:
assert Expression1; //1st Form assert Expression1 : Expression2; //2nd Form
Where, Expression1 - is a boolean expression. Expression2 - is a information expression, which could be of any data type.
Note: When Expression1 evaluates to false, then the program generates an Assertion Error or else not. ------------------------------------------ Yeah I too agree Assertion are very easy, initially I also thought of skiping it but, once I got the above syntax clear in my mind...I never made any mistake.......always remember the Expression1 should finally return boolean and Expression2 should return any data except "void". Some time in place of Expression2 a function could be called that returns void type. This will be a compiler error.
In exam you could except one to two questions on assertion. Some time they ask you where assertions should be used....
I took the test last week and I think I got somewhere around 5 questions on assertions. Based on the questions I got and the practice questions I've seen, I would recommend that you:
1. Know the format of an assertion statement and what it does. 2. Understand the difference between appropriate and inappropriate use of assertions. 3. Know how to use -ea, -da, -esa, and -dsa to enable assertions for specific classes and packages at runtime. 4. Know how to use a compile option to compile assertion statements into your code.
This question is to Robert. Forgive me if I am deviating. What was ur score? And did you take these mock tests-http://www.danchisholm.net/ I seem to be averagin in my mock tests lower than what I hope to score in the actual. What do u think of the mock tests? [ June 21, 2004: Message edited by: Swamy Nathan ]
Joined: Jun 18, 2004
I got 100% on the exam, believe it or not. I say "believe it or not" because I think it means my educated guesses were either very educated or very lucky.
I took three of the comprehensive exams on Dan Chisholm's site. In general all of the mock exams I took were slightly harder than the actual test, although that could be because I learned something from every question I got wrong.