SCJP

From HerzbubeWiki
Jump to navigation Jump to search

Overview

This page is intended to keep track of my progress in becoming a Borg Sun Certified Java Programmer.


Process

I'm going to study using the book SCJP Sun Certified Programmer for Java 6 Study Guide: Exam (310-065) (look it up). I plan to work through one chapter per day, which is probably too optimistic. I also plan to complete the certification sometime during January 2010, which should be feasible from looking at the book's table of contents. If I can keep up the proposed pace of 1 chapter/day I should have my certificate early in January, otherwise it will be later.


Progress

Chapter 1: Declarations and Access Control

Started
24.11.2009
Finished
26.11.2009
Duration
3 days
Result of self test
  • 7 out of 9 questions answered correctly (77%)
  • Question 6 answered wrongly because I was not taught the fact that it is legal to re-declare an interface implementation
  • Question 9 answered wrongly because I didn't notice the static context from which an instance method was invoked (aka trick question)
  • I noticed that a few other things had not been properly explained by the book, but in these instances I had guessed the answers correctly
    • The import syntax has never been fully explained
    • "Short" and "Boolean" are legal classes; I thought at first that these were used as trick questions because primitives are "short" and "boolean"
    • I had not known the syntax for a for loop "for(Days d : Days.values() )"
Notes
  • No questions will be asked about Sun's Java Code Conventions (p. 4)
  • Only a few questions will be asked about the basics of the JavaBeans API (p. 8)
Open questions
  • What other "connecting characters" besides "_" are allowed at the beginning of an identifier? What is a connecting character?
  • How does import work exactly? It has not been explained yet that we can refer to a class without an import if we use the class' fully qualified name (e.g. ch.herzbube.example.Foo)
  • What are the default values for instance and class variables of primitive types?
  • What exactly is boxing?


Chapter 2: Object Orientation

Started
30.11.2009
Finished
01.12.2009
Duration
2 days
Result of self test
  • 13 out of 15 questions answered correctly (86%)
  • Question 9 answered wrongly because, coming from C++, I thought casting is a no-op
  • Question 15 answered wrongly because I obviously do not know enough about arrays, var-args and so-called boxing
Notes
  • Tight encapsulation (e.g. always use setters/getters), loose coupling (delegation, has-a rather than is-a), high cohesion (well-defined responsibilities)


Chapter 3: Assignments

Started
02.12.2009
Finished
03.12.2009
Duration
2 days
Result of self test
  • 10 out of 13 questions answered correctly (77%)
  • Question 2 answered wrongly because it is totally unclear to me why the code example does not work; after all, short s = 7; works (the int literal 7 is converted by the compiler to a short), so why should foo(7); not work (with this method declaration: void foo(short s) {})???
  • Question 7 answered wrongly because...
    • The book has a printing error
    • I had not known that it is possible to access a private instance variable of a class or enum if that class/enum is an inner class/enum
  • Question 8 answered wrongly because I was not introduced properly to how scoping works in a for loop (for (int i = 0; ...): in this example, the variable i is declared in the scope outside of the for loop)
Notes
  • System.gc() is no longer a topic for the exam. It is recommended to leave GC to the JVM


Chapter 4: Operators

Started
03.12.2009
Finished
03.12.2009
Duration
1 day
Result of self test
  • 9 out of 10 questions answered correctly (90%)
  • Question 4 answered wrongly because I didn't see that on the last line numeric addition would occur before string concatenation due to the order of evaluation
Notes
  • Exam won't test bit shifting operators, bitwise operators, two's complement, divide by zero stuff
  • Only the following compound operators are on the exam: +=, -=, *= and /=
  • Operator precedence is not tested much; known exceptions: *, / and % have higher precedence than + and -, stuff on the right hand side of a compound operator is evaluated first


Chapter 5: Flow control, Exceptions, and Assertions

Started
03.12.2009
Finished
03.12.2009
Duration
1 day
Result of self test
  • 15 out of 16 questions answered correctly (94%)
  • Question 5, a rather easy question BTW, answered completely wrong with multiple mistakes; I must have had a blackout...
  • Question 15: I did not know about "overloading" main(), so I guessed - the guess was correct, but my reasons were all wrong
Notes
None


Chapter 6: Strings, I/O, Formatting, and Parsing

Started
04.12.2009
Finished
07.12.2009
Duration
2 days
Result of self test
  • 9 out of 15 questions answered correctly (60%)
  • Question 1 answered wrongly because I hadn't understood how regexps work when a null string is matched
  • Question 2 answered wrongly because I completely misread the code
  • Question 3 answered wrongly because I still do not know enough about primitive wrapper classes and boxing
  • Question 6 answered wrongly because I was not entirely sure about the parameters of java.util.text.DateFormat.getDateInstance() (50/50 question)
  • Question 7 answered wrongly because answered too hasty
  • Question 11 answered correctly, but for all the wrong reasons
  • Question 15 answered wrongly because java.util.Scanner.nextXxx() has not been properly explained
Notes
  • Versioning of serializable classes is not tested by the exam
  • Fields in java.util.Calendar are not tested by the exam
  • So far this chapter holds the record for sloppy explanations

Open questions:

  • Unbelievably, BufferedWriter is mentioned but not discussed


Chapter 7: Generics and Collections

Started
15.12.2009
Finished
17.12.2009
Duration
3 days
Result of self test
  • 10 out of 16 questions answered correctly (62%)
  • Question 6 answered wrongly because I made a stupid mistake (overlooked a changed super class)
  • Question 8 answered wrongly because I made a stupid mistake (didn't analyze return type properly)
  • Question 11 answered wrongly because I made a stupid mistake (didn't analyze the container type properly -> HashSet involves hashCode())
  • Question 13 answered wrongly because I couldn't remember details of tailMap() anymore
  • Question 15 answered wrongly because I mistakenly thought the Comparable interface was belonging to Object
  • Question 16 answered wrongly because I had forgotten that binarySearch requires the same Comparator that was used before for sorting
  • Question 7 answered correctly, due to an "informed guess"
Notes
-


Chapter 8: Inner Classes

Started
18.12.2009
Finished
22.12.2009
Duration
2 days
Result of self test
  • 8 out of 12 questions answered correctly (66%)
  • Question 5 answered wrongly because I made a stupid mistake (access to members of the referenced type)
  • Question 6 answered wrongly because I haven't paid enough attention to anonymous inner classes
  • Question 9 answered wrongly because I have forgotten init block syntax
  • Question 12 answered wrongly because I once again fell for the classic "can't invoke instance methods from static context"
Notes
-


Chapter 9: Threads

Started
23.12.2009
Finished
28.12.2009
Duration
2 days
Result of self test
  • 10 out of 17 questions answered correctly (59%)
  • Question 1 answered wrongly because I didn't remember that when implementing an interface the methods must be marked public
  • Question 3 answered wrongly because I forgot that Thread.sleep() requires try/catch
  • Question 7 answered wrongly because I hadn't realized that Thread.notify() and Thread.notifyAll() require synchronization; was this explained?
  • Question 13 answered wrongly because I didn't know that the default implementation of Thread.run() invokes the run() method of its target; this has not been explained
  • Question 14 answered wrongly because I didn't know that Thread.join() requires try/catch; this has not been explained
  • Question 15 answered wrongly because I didn't analyze the possibility for the last answer careful enough; this question took too much time to answer!
  • Question 17 answered wrongly because I made a stupid mistake
Notes
-


Chapter 10: Development

Started
29.12.2009
Finished
29.12.2009
Duration
1 day
Result of self test
  • 4 out of 12 questions answered correctly (33%)
  • Question 2 answered wrongly because I didn't remember that "$" is a valid variable name
  • Question 3 answered wrongly because I forgot that import looks for folders within classpath directories
  • Question 5 answered wrongly because I thought that the system classpath always had precedence; what is the system classpath?
  • Question 6 answered wrongly because I didn't see that the two classes were in different packages
  • Question 7 answered wrongly because I didn't remember assert() stuff any more
  • Question 9 and 12 answered wrongly because I forgot that the current folder (".") must be part of the classpath if the "java" command should find a .class file in the current folder
  • Question 11 answered wrongly because ... I don't know, I still think the code is missing an "import myApp;" statement
Notes
-


Research from Sun's website

The main pages for the certification are here (English) and here (German). The goal of the certification is described like this:

Achieving the SCJP certification provides clear evidence that a programmer 1) understands the basic syntax and structure of the Java programming language, and 2) can create Java technology applications that run on server and desktop systems using Java SE 6.

To achieve the SCJP certification, one needs to complete a single exam. The exam exists in variants for J2SE 5 and J2SE 6. I am interested in the latter only. The exam's key points are these:

  • No prerequisites (specifically it is not necessary to have a certificate as SCJA [Sun Certified Java Associate])
  • Exam code: CX-310-065
  • Cost: CHF 390.59 (USD 300)
  • Exam type: Multiple choice and Drag and Drop
  • Number of questions: 72
  • Pass score: 65% (47 of 72 questions)
  • Time limit: 210 Minutes


More links:

  • Training courses: Here (English) and here (German)
  • Preparation courses: here (English) and here (German)
  • Practice exams: here (English) and here (German)