Showing posts with label SCJP. Show all posts
Showing posts with label SCJP. Show all posts

6 July 2009

Passed the SCJP - A reflection about the exam

It's finally done! I passed the SCJP last June and therefore I would like to reflect things I have learned and share my thoughts with you.

Study material
For the SCJP exam preparation I used the web learning lessons provied by SUN and SCJP Java 6 Study Guide. The web learning lessons and espessially the example exams where really valuable to me . They give you the feeling how hard the exam can be and what kind of questions could be asked.

To all future students: Repeat the test exams as much as you can. This will get you through the SCJP exam.

The 'SCJP Java 6 Study Guide' introduces all SCJP topics very well and contains a CD-ROM with additional test exams. These test exams are definitely harder than those of SUN but I really recommend to take these test exams. If you pass these test exams you will definitely pass the real SCJP exam!

Exam day
I took the exam at test-site in Zurich downtown. First of all I had to identify myself with two different identifcation documents (e.g. passport, creditcard or drivers licence). After that I had to hand out my watch, wallet and my bag to the supervisor. All the thing were looked in a safe. Done! After that my supervisor introduced me to my exam workstation and told me that several cameras are observing me during the exam. Well therefore try NOT to cheat during the whole exam. It not worth it.

Next steps
Currently I am thinking about further steps within the SUN Certification Programm. One step could be the 'SUN Certified Java Developer', a very generell continuation of the SCJP based on developing a client/server desktop application using Swing. Another step could be the 'SUN Certified Web Component Developer'.

I have not yet decided what certification is going to be next but I am tending to the SCJD because may knowledge about SWING is quiet poor :(

27 May 2009

SCJP - Now it gets strange

Which two about using the java.io.Serializable class are true? (Choose two.)

A) If Dog extends Animal, then Animal must implement java.io.Serializable in order to serialize an instance of Dog.
B) If Dog has-a Collar, then Collar must implement java.io.Serializable in order to serialize an instance of Dog.
C) If Dog extends Animal and Animal implements java.io.Serializable but Dog does NOT implement java.io.Serializable, you can serialize an instance of Dog.
D) When an instance of a subclass is deserialized, none of the constructors in it's constructor chain will ever be invoked.
E) If you mark a class's instance variable volatile, and then serialize an instance of that class, the state of the volatile variable will be lost during serialization.

Sun's says: Options B and C are correct. A class's superclasses don't have to implement Serializable in order to be serialized, and if a superclass doesn't implement Serializable then it's constructor will run during deserialization. A transient variable's state is lost during serialization, but a volatile variable's state is not lost.
I really do agree with option C but cannot understand why option B should be absolutely right. I still can serialize the Dog instance even if the included Collar does not implement Serializable. I could mark the Collar instance variable transient and everyone would be happy at runtime.

SCJP - This one could knock me out

Can anyone solve this? I've chosen wrong :( And probably learned something.



1. class Test4 {
2. public static void main(String [] args) {
3. boolean x = true;
4. boolean y = false;
5. short z = 42;
6.
7. if((z++ == 42) && (y = true)) z++;
8. if((x = false) || (++z == 45)) z++;
9.
10. System.out.println("z = " + z);
11. }
12. }


What is the result?

A) z = 42
B) z = 44
C) z = 45
D) z = 46
E) Compilation fails.
F) An exception is thrown at runtime.