I passed the
SCJP 1.4 with 90% today, I want to share with all of you my experience. (my English is not good, pls forgive me ^^)
First I must say thanks to
Kathy Sierra and Bert Bates --- "Sun Certified Programmer & Developer for
Java 2 Study Guide (Exam 310-035 & 310-027)"
and
Dan Chisholm (mock exam).
Background :
Before preparing for the SCJP, I have taken a course about JAVA (introductory level). Then I spend about 3 months on preparing for the exams.
Actually, I can shorten my preparation time. It is because the first book I read is for the 310-025 (platform 1.2) --- "Sun Certified Programmer for Java 2 Study Guide (Mc GrawHill)", it is very useful to me. I read the 310-025 study guide because it is hard to find other 310-035 reference book at that moment (in HK).
Therefore, I have read 2 reference books (310-025 and 310-035). Although I spend more time due to studying some overlapping materials, this gave me a strong understanding of the basic materials.
Preparation:
I have done all questions after each chapter and its mock exams of the books (I have mentioned above)I have read. The mock exams by Kathy Sierra and Bert Bates is very similar to the real exams.
In addition, I have done nearly all questions (platform 1.4) provided by Dan Chisholm . Personally, the materials that Dan's mock exams involved are in much more details. To certain extent, it is more difficult. Although some of them may be out of the scope of the exams, they gave me a better understanding about the Java knowledge.
Some recommendations for the exams:
1.
Object[] obj = new Object [0];
System.out.println(obj[0]);
it will give out ArrayIndexOutOfBoundsException instead of NullPointerException.
2.something may be strange about the assertion syntax. e.g.
assert (i > 0) ? "assertion true" : "assertion false";
3. this kind of code may be appear
boolean a = false;
boolean b = true;
boolean c = ( (a = true) | (b = true) );
4. be careful of the Wrapper class constructor
e.g.
int a = Integer.parseInt("123FGH"); //will have runtime error instead of compile time error
5. be careful of the array initialization:
int b [][] = {1,2,3}, {4,5,6}; //compile error
int c [] = new int[4] {1,2,3,4}; // compile error
6. u must know what's the benefit of encapsulation
7. u must know the range of short and byte
8. be careful the result of
Math.sqrt(-4D) // NaN (Math.sqrt() will not throw any exception
9. the switch statement:
float f = 9.2f;
switch (f) {
}
// not accept float
10. be careful method can have the same name as
constructor.
e.g.
class AA {
void AA () { //not constructor !
}
public static void main (
String args[]) {
new RealQuestion13();
}
}
11. be careful some trap
e.g. while (1) {} // will not compile
12. be careful the start() nature of
Thread.
e.g.
class AAA implements Runnable {
public void run () {
System.out.println ("run ... ");
}
public void start() {
System.out.println("start ... ");
}
public static void main (String args[]) {
new Thread( newAAA() ).start();
}
} // you better compile and run it
13.
noted that Thread.sleep() will not release the lock, notify() should be call on the object but not the thread
14.
you must know " x >> y = x / (2 to the power y)" and "x <<y = x * (2 to the power y) ", this can save your time and u can use this to check your calculation. ( Thanks to Kathy Sierra and Bert Bates here to mention it in the ExamWatch)
15.
be careful of the access modify involved in the interface.
e.g. interface variable is implicitly public, static and final. method declared in interface is implicitly public and abstract. Top level interface is implicitly public and abstract
nested interface is implicitly public, static and abstract .....
16.
there are several questions to
test your knowledge of "String is immutable" (I've got 2 questions in the exams)
e.g.
String x = "AAA';
x.concat ("BBB");
System.out.println (x); // will output AAA instead of AAABBB
17.
be careful if equals() is not overriden, it is equal to "= =" operator.
18.
be careful sometimes " = " will be used in the if statement instead of " = = "
19.
be noticed that if exception is catch (either runtime or checked), the program will still run after the catch statement
till the end.
That's all of my recommendations
Hope this can help
--------------------
Vince Hon
HK student
Study at CUHK
like JAVA.