Preparing for the Java SE 7 Programmer II (1Z0-804) exam

java logo

Recently, I passed my exam for Java SE 7 Programmer II (1Z0-804) with a score of 75%.I thought this exam is quite difficult and it takes some time to prepare. Therefore, in this post I would like to share my experiences. Hopefully it will be useful to others.

Exam questions

I’m not allowed to share the exam questions. However, I can give some hints about the type of questions that will be asked. In my exam I noticed a lot of questions were related to multithreading and class design (usage of casts, overrides, overloads, co-variant overloads, nested classes, etc…). In my case the exam coverage was as follows:

  • Threads & Concurrency (25%)
  • Class design (20%)
  • Material related to Java SE 7 Programmer I (10%)
  • JDBC (5%)
  • Exceptions (5%)
  • Assertions (5%)
  • Java IO, NIO & NIO2 (10%)
  • Generics & Collections (10%)
  • String processing (5%)
  • Localization (5%)

When taking this exam especially timing is important. You have to answer 90 questions in 150 minutes, i.e., you have 150/90 = 1 minute and 40 seconds per question. Please take into account that this amount of time is usually too short to answer questions related to Threads & Concurrency and Class design. Therefore, it’s very important that you are able to answer the questions related to the remaining topics very quickly, e.g., say within 30 to 60 seconds.

Preparation material

In order to prepare for the exam I used various resources. Below I will list the pros and cons of those resources.

The book Oracle Certified Professional Java SE 7 Programmer Exams 1Z0-804 and 1Z0-805: A Comprehensive OCPJP 7 Certification Guide

Pros: the book gives you a good overview of the topics you have to know for the exam. It’s a good starting point to prepare for the exam.

Cons: it’s too general. When doing the exams or mock exams you will discover that you are missing information. For instance, topics regarding RandomAccess files and using the buffer’s mark functionality are not discussed.

Recommendation: read the book at least once in order to know which topics to expect on the exam. More detailed information regarding the topics can be found on the internet or using exam simulation software.

Oracle websites 

Pros: The oracle websites contain a lot of information, which might be overwhelming in the beginning. However, most exam questions are based on the information given on those pages. Especially the notes and special cases that are mentioned on the tutorial pages are helpful. For instance, on the tutorial page they mention the following regarding overriding and hiding methods:

“Static methods in interfaces are never inherited.”

This piece of information is useful when answering questions regarding class design for instance.

Cons: the information is overwhelming and it will take some time to process. Besides, it’s incomplete, not all information can be found in the API or on the tutorial pages. For more detailed information I would recommend to use the java specification as reference.

Recommendation: Read all tutorial pages at least once and make a list of all those notes and special cases. On the exam there will be implicit questions regarding those notes. Regarding the API only read the methods which are not clear to you initially. In addition, you should also check for exceptions and overloaded methods related to the method you are looking at.

Whizlabs

Pro: Good website in case you want to practice exam questions regarding Exceptions and NIO2. In addition, the website gives good and detailed explanation for each answer.

Cons: The mock exam questions are not covering all topics. There is strong focus on exceptions and NIO2 functionality. To me it felt the questions were a bit outdated. In my opinion they were too easy and more a continuation of the java programmer I exam.

Recommendation: Just practice and understand all exam questions, but don’t assume that when you are finished that you are ready for the exam.

Enthuware

Pro: Large exam question bank covering all topics. The questions vary from easy to very hard. Furthermore, the explanations for all questions are very detailed and clear.

Cons: Some questions are too difficult and can’t be compared with the level of difficulty you will face on the real exam. In addition, the mock exams may demotivate you, since the mock exams are very challenging and you are wrong most of the time.

Recommendation: Make all the exam questions and keep practicing. In addition, make notes regarding the mistakes you made. Initially the questions are hard, but you get used to it the more you learn and practice. The level of difficulty is more or less the same as the real exam.

My notes

When preparing for this exam I made some notes, it might help you during the preparations. Some of the notes are quite specific and even not mentioned in the Java API. You can find my notes here:

http://www.brettrijnders.nl/2014/09/java-se-7-programmer-ii-1z0-804-notes/

Finally

The Java SE7 programmer II exam is hard, it’s much harder than the Java SE 7 Programmer I exam. So you better be prepared, don’t underestimate it! The preparation time will probably vary between two to six months. I hope that the shared information is useful and hopefully it will help you with preparing the exam more efficiently. Feel free to ask any questions, I will try my best to answer them.

Java SE 7 Programmer II (1Z0-804) notes

This post contains a collection of notes that I have made when I was preparing for the Java SE 7 Programmer II exam. For tips on how to prepare for this exam please see my other post.

Java SE 7 Programmer II notes

String processing

  • The delimiter string itself doesn’t act as a delimiter but each character in the delimiter String acts as a delimiter. So StringTokenizer(“abcde”, “bd”) will return a, c, and e and not abcde because b and d both act as a delimiter.
  • When using “\s” as tokenizer, don’t forget to add additional backslash to escape the “\”, i.e., you should use “\\s”.
  • The word boundary is indicated by “\\b” and includes spaces, tabs, special characters and beginning and end of the line.
  • When using explicit index (e.g., %1$) the index number always starts with 1.
  • String is immutable while StringBuilder and StringBuffer are not.
  • For regular expressions the word boundary token “\b” does not actually match any character. For example the matches differ if you match with \btest\b or with \stest\s for the string “test test test test”. The first pattern will give 4 matches while the second will give only 1 match (the second “test”).
  • When using split(String regex) the trailing empty strings won’t be included.
  • The default precision for floating point number is 6.
  • When padding is specified the width needs to be specified as well, otherwise an exception is thrown.
  • The parameter %f only accepts floats or doubles, it doesn’t accept booleans, integers, chars or anything else.
  • When using Scanner there are many hasNextXXX and nextXXX methods, except for hasNextCharacter and nextCharacter, they do not exist!
  • Note that for word boundaries (when using \b as pattern) the parts before and after a word are also considered as word boundaries, even if there is no visible boundary such as white space. This means that when you use the pattern \b\w*\b on “someword” it gives someword back as a match.
  • Calendar has three important methods:
    • Add(int aField, int amount).
    • Roll(int aField, int amount), is quite similar to add(…). However, it does not modify the “larger” fields, i.e., if you add 11 months to the date in March 2014 then it would yield Februari 2014 and not Februari 2015, hence the larger fields (in this case year) is not modified.
    • Set(int aField, int value).

Continue reading