Thursday, 18 April 2013

Indian readers can now buy OCPJP 7 book from Flipkart!

We have received many queries from Indian readers on how to get the book in India. 

If you're from India, you can now buy the imported edition of the book Oracle Certified Professional Java SE 7 Programmer Exams 1Z0-804 and 1Z0-805 from flipkart. Flipkart provides 17% discount - its Rs. 2640 Rs. 2191 (17% Off). 
Alternatively, if you prefer to buy an e-book, you can get it from apress site: The price of ebook is $32.99, and if you're from India the apress site will automatically include $24.74 discount and the final price of the book is $8.25.  


Sunday, 14 April 2013

Top 5 myths and misconceptions about OCPJP 7 exam

Myth #5: If I pass OCAJP 7 exam, I'll pass OCPJP 7 exam with ease - both are similar except for top-level exam topics!   

No, no, no. OCAJP 7 and OCPJP 7 are different beasts. OCAJP 7 is much easier than OCPJP 7 exam. Oracle wanted a large base to start with, and hence OCAJP covers only language fundamentals; just take a look at the 
OCAJP 7 exam topics to understand what we mean. However, OCPJP 7 is a more difficult exam which covers a wide range of exam topics (JDBC, Concurrency APIs, localization, design patterns, ...) as well as topics in depth (just take a look at generics and collections topic, for example). 

Yes, some questions in OCAJP 7 could be as difficult as OCPJP 7 exam, but in general, OCPJP 7 requires much more preparation. Overall, it would be a very bad idea to appear for OCPJP 7 exam without any preparation, but it may be okay for OCAJP 7 if you've considerable programming experience in Java.  

Bottom-line: Don’t measure both the exams with the same scale. If you've passed OCAJP 7 exam, don't look at OCPJP 7 exam as something similar - they are very different at their difficulty level. So, prepare more for OCPJP 7 exam even if you've cracked OCAJP 7 with ease. 

Myth #4: I have many years of work experience in Java, so I don't have to prepare for the exam. 

No matter how much real-world programming experience you might have, there are two reasons why you should prepare for this exam to improve your chances of passing it: 
  • You may not have been exposed to certain topics on the exam. Java is vast, and you might not have had occasion to work on every topic covered in the exam. For example, you may not be familiar with localization if you have never dealt the locale aspects of the applications you were engaged with. Or your work might not have required you to use JDBC. Or you’ve always worked on single-threaded programs, so multithreaded programming might be new to you. Moreover, OCPJP 7 emphasizes Java 7, and you might not have been exposed yet to such Java 7 topics as NIO.2, new concurrency APIs, and enhancements such as try-with-resource statements. 
  • You may not remember the unusual aspects or corner cases. No matter how experienced you are, there is always an element of surprise involved when you program. The OCPJP 7 exam tests not just your knowledge and skills in respect of regular features, but also your understanding of unusual aspects or corner cases, such as the behavior of multithreaded code and the use of generics when both overloading and overriding are involved. So you have to bone up on pathological cases that you rarely encounter in your work.

Bottom-line: Work experience in Java is good, but you'll still need to prepare. A grounded and practical approach would be to take mock-exams in our book - if you pass the mock exams, you're likely to pass the real exam - at least this approach will save you $300! 

Myth #3: OCPJP 7 exam questions will be equally distributed among the exam topics.  

If you look at the list of exam topics for OCPJP 7 exam (see this link), you'll find 12 top-level exam topics. Somehow, there is a misconception that you'll get 7 to 8 questions (i.e., 90 questions / 12 exam topics = 7.5 questions) per exam topic. However, based on experiences in taking exam, this is not true. Specifically:  

·         You're sure to get questions on fundamentals, i.e., questions from OCAJP 7 exam topics, so, this distribution doesn't hold. 
·         You may get more questions on a specific topic (such as generics and collections) when compared to other topics. 
·         You may not even get any questions on a topic. For example, many takers of exam have reported that they did not get any questions in topics such as Concurrency or JDBC.  

Bottom-line: Prepare well for all the exam topics and don't be surprised if you get a large number of questions from one exam topic and very few (or even no) questions on some exam topics. 


Myth #2: OCPJP 7 exam questions will be exactly from the exam topics.  

Yes, Oracle has listed exam topics (both topics and sub-topics) for the OCPJP 7 exam (see this
 link). The questions from the exam will be mainly from these high-level exam topics. However, exam questions are not constrained to be exclusively from the topics on the exam syllabus:

·         You might, for example, get questions on Java fundamentals (a topic in OCAJP syllabus) concerning the basics of exception handling and using wrapper types. Or consider the exam topic "Test equality between Strings and other objects using == and equals ()" listed under "Using operators and decision constructs" in OCPJP 7 exam - you may get questions on this exam topic. 
·         You might also get questions on topics related to those on the exam syllabus but not specified in it. For example, serialization and use of the transient keyword are not explicitly mentioned in the OCPJP exam syllabus, but they can come up in the actual exam because they are related to reading and writing streams—and one of these is ObjectStreams, which relates to serialization!
·         Consider this exam topic "Format strings using the formatting parameters: %b, %c, %d, %f, and %s in format strings." under "String processing" in OCPJP 7. This list of formatting parameters is only an indication and you may get questions on flags such as ‘-’, ‘^’, or ‘0’ or use of escape character % and use %% to print %. 
·         Some of the Java 7 topics are not explicitly mentioned anywhere in the exam topics. For example, consider two sub-topics in "Upgrade to Java SE 7" top-level exam topic "Language enhancements": "Develop code that uses String objects in switch statement", "Develop code that uses binary literals and numeric literals with underscores". In our experience, we have got questions from these two exam topics which are not at all mentioned in main OCPJP 7 exam (IZO-804)! 

Bottom-line: It would be a folly to strictly adhere to the exam topics listed by Oracle for the exam. Grounded on our practical experience in the exam, it's a good strategy to be familiar and prepare for all the top-level topics given in the exam syllabus, including Java 7 language features.  


Myth #1: OCPJP 7 = (Older version of OCPJP or SCJP) + Java 7.

The top in our list of myths and misconceptions is something that is surprisingly common among OCPJP aspirants. This is the misconception that most of you may disagree with us. But never mind, we'll tell you the truth!

Those who are familiar with older versions of the OCPJP (such as OCPJP 6) exam or SCJP exam (such as SCJP 5) exam think that OCPJP 7 is nothing but the same old exam plus coverage of features introduced in Java 7. It is simply not true. In two major ways OCPJP 7 and its older avatars are different: OCPJP 7 is both broader and deeper than its older versions. Let's dig deeper on these two aspects.

OCPJP 7 has broader scope: This is easy to explain. The OCPJP 7 exam covers more topics than the OCPJP 6 and 5 exams and their Sun predecessors, including JDBC, localization, NIO.2, and concurrency APIs. Yes, OCPJP 7 also covers new features of Java SE 7, including try-with-resources statements, new APIs in JDBC, string-based switches, and binary literals; but that is only one of the differences between OCPJP 7 and its older versions. Here is the list of exam topics in OCPJP 6 and OCPJP 7:  
OCPJP 6 exam topics
Declarations, Initialization and Scoping 
Flow Control
API Contents
Concurrency
OO Concepts
Collections / Generics
 Fundamentals
OCPJP 7 exam topics
Java Class Design
Advanced Class Design
Object-Oriented Design Principles
Generics and Collections
String Processing
Exceptions and Assertions
Java I/O Fundamentals
Java File I/O (NIO.2)
Building Database Applications with JDBC
Threads
Concurrency
Localization


A considerable number of "language fundamental" topics are now moved to OCAJP 7, which is a prerequisite for OCPJP 7 exam. 

OCPJP 7 has more in-depth coverage of exam topics: This part is harder to explain. One of the objectives of Oracle when they revised the exam to OCPJP 7 is to make sure that fewer candidates pass the exam. With this in mind, when compared to OCPJP 7, the questions in OCPJP 7 are more difficult, there are more number of questions need to be attended within the same time period of 2.5 hours, and there is a slight increase in the percentage required to pass the exam (see table): 


Exam duration
OCPJP 6 exam
2 hrs 30 minutes (150 mins)
OCPJP 7 exam 
2 hrs 30 minutes (150 mins)
Number of questions
60 Questions
90 Questions
Pass percentage
61%
65%


The other minor differences between OCPJP 7 and its older versions is that all questions in OCPJP 7 are multiple choice questions. Older versions of the exam featured drag-and-drop and match-the-options style questions that are withdrawn in OCPJP 7 exam.

Bottom-line: Don't look at OCPJP 7 as just incremental improvement of its older version(s), and take it more seriously to prepare well for the exam (unless you're ready to throw away $300 in the dustbin). 

Sunday, 31 March 2013

SCJP/OCPJP 6 or 7?

 "What to do? SCJP/OCPJP 6 or 7?" If you are struggling with this confusion then do not worry, you are not alone. It is one of the most common confusion for any SCJP/OCPJP aspirant.
In our opinion, it is always better to learn the latest concepts. If you are a newbie in Java then our recommendation is that you go with OCPJP 7. This exam covers Java SE 7 features that will give you an edge over SCJP 6. Any potential employer will choose the most updated candidate provided the options.
Even if you are an experienced Java programmer, in that case also we recommend you to go for OCPJP 7. During OCPJP 7 exam preparation, you will understand the most recent features in the language that will improve your employability.
In fact, the OCPJP 7 exam is much more difficult to clear than its predecessor. This fact makes the OCPJP 7 exam more prestigious and more acceptable. Oracle clearly differentiated between the associate exam (OCAJP, the easier one) with OCPJP exam (definitely the difficult one) and hence the credibility earned by OCPJP 7 certification cannot be matched by the older certification.

Friday, 29 March 2013

Source code for OCPJP 7 book available for download!

You can now download the source code for our book "Oracle Certified Professional Java SE 7 Programmer Exams 1Z0-804 and 1Z0-805" from Apress webpage for our book: http://www.apress.com/9781430247647. From this link, click the "Source code/Downloads" tab and press the link "Download now". No, you need not have purchased the book to download the source code - anyone can download. 

Monday, 25 March 2013

Indian edition of OCPJP 7 book

Good news for Indian readers of our OCPJP 7 book. The e-book is available on Apress in just $8.25 for Indian readers. Really great, right?

What you need to do is: go to our book page at Apress site and add a book to your cart by clicking on "Buy eBook". That's it. If you are in India then Apress site will add a discount and the final price will come down to $8.25. Take a look at the snapshot given below.

Saturday, 23 March 2013

How to prepare for the OCPJP 7 exam

One of the important questions you may have when you start preparing for the OCPJP 7 exam is how to go about preparing for the exam. In this post, we answer some of these questions in the form of an FAQ. We mainly focus on the OCPJP 7 exam (Oracle exam codes IZ0-804 and IZ0-805). Note that Chapter I in our OCPJP 7 book addresses many of these topics. 

1.   How long should I prepare before appearing for the exam? 

Short answer: Depending on your level of knowledge and experience in OCPJP 7 topics, it may take from 1 month to 6+ months.  

Long answer: Preparation time depends on your knowledge and experience in Java programming. If you have already cleared OCAJP 7 (Oracle Certified Associate Java Programmer 7) exam, or any of the older Java certifications such as SCJP, it usually takes 1 months to 6 months to prepare for the exam. 

Why does it take time to prepare for the OCPJP 7 exam? Because it is a reasonably difficult exam to crack! For instance, compared to SCJP 5 exam, OCPJP 7 exam is both "broader and deeper": OCPJP 7 covers more topics than SCJP 5 such as NIO.2 and java.util.concurrent utilities; questions asked in OCPJP 7 are more difficult than SCJP 5. 

If you have just cleared OCAJP 7 and plan to appear for OCPJP 7 exam, we would recommend you to spend at least 6 months to prepare for the exam (subject to individual preparation, experience, and available time). You need to spend quite a bit of time to prepare difficult topics such as generics, design patterns, multi-threading and concurrency utilities. 

Even if you are an experienced Java programmer, you may not have exposure to certain topics that are covered in OCPJP 7. For example, if you have never written any code for localization (aka internationalization), then you'll need to prepare on this topic before appearing for the exam. Another possibility is that you may not have exposure to Java 7 features such as try-with-resources statement, diamond syntax in generics, and switch based on strings. Java 7 also has API changes for JDBC, NIO, concurrency utilities, etc. 

Remember that OCPJP 7 exam covers corner cases, unusual aspects and tricky aspects in language features and APIs. So, you'll need to brush-up on difficult topics such as semantics of multi-threading and unusual aspects involved in generics. 

OCPJP 7 exam tests your knowledge and understanding of Java language and library and does not test how well you can memorize things. However, there are certain aspects in OCPJP 7 exam will require you to remember such as format strings (in printf), regular expression syntax, glob syntax (in NIO.2), and format strings for creating custom locales. These topics require preparation, and if you ignore our warning and go ahead to take the exam without any preparation,  then you'll not be able to confidently answer many questions in OCPJP 7 exam. 

If you're ready to throw $300 in dustbin, then do appear for OCPJP 7 exam without any preparation whatsoever! Or a more sensible thing: transfer those dollars to our bank account and we'll gladly accept that ;-)   

Bottom line: No matter how experienced you are in Java, it is unlikely that you'll crack the exam without any preparation!  

2. How should go about preparing for the exam? 

Of course, the first thing we would suggest is to buy our book and read it :-) 

The second thing we suggest is to not to stop preparation with reading our book! Don't get us wrong - the book covers all the topics to the required breadth and depth, but OCPJP 7 is not an easy exam and there is more you need to do to be confident of clearing the exam. What the book provides you is knowledge needed to appear for the exam, but to crack the exam, you need to understand and internalize the concepts! How to achieve that? 

The key to cracking OCPJP 7 exam is to code, code, and code! It is through hands-on programming that you'll really get to understand and internalize the concepts. For example, reading about differences between nested, inner, and anonymous classes is only the first step; more important thing is to really get an intuitive understanding on what these differences are and know the nitty-gritty details of the differences between these variants. The way to achieve it is through writing code. If you don't have good opportunities to learn Java as part of your work, you can try some toy projects.  

Also, there are always topics that you would feel you require more preparation. For example, if you have not done any JDBC programming before, you may want to read more about it. A very good resource for further reading is Oracle's Java tutorial. Specifically, for OCPJP 7 preparation read the topics related to this exam in Oracle's tutorial.

It is important to focus on the exam topics especially if you are pressed for time. For this reason, reading general Java tutorial books or references is not a good idea for exam preparation when your exam dates are close by. Why? In general reading general Java tutorials or references is good, but Java is vast and there are just too many topics to read and learn. You're likely to get lost in ocean of details without getting into required depth in topics relevant to OCPJP 7. For example, java.util.concurrent utilities are not covered well in most Java books meant for general reading; however, OCPJP 7 requires you to have considerable knowledge in these utilities. Also, many topics that are covered in detail are simply irrelevant for OCPJP 7 exam, such as Swing or AWT programming, Network programming, JavaBeans, Security, RMI, and Reflection. 

3. Which topics should I focus for effective OCPJP 7 exam preparation? 

Focus especially on Java 7 features, focus on topics that are difficult in general for most OCPJP 7 exam takers, and focus on topics that are difficult to you. 

OCPJP 7 has special focus on Java 7 exam topics. As we have already mentioned, these are topics such as try-with-resources, precise rethrow, diamond syntax, binary literals, and switch for strings in addition to API changes in JDBC, NIO.2, etc. From our experience taking the exam, we found a larger share of questions from this topic (one possibility for disproportionate number of questions on Java 7 is that Oracle's question bank for IZ0-804 exam and IZ0-805 exam are shared!). Since you're likely to get a significant number of questions on Java 7 topics, better be prepared for it.  

In general, certain OCPJP 7 topics are difficult for most OCPJP 7 exam takers, such as design patterns, generics and concurrency utilities. So, we would recommend you to prepare well for these topics.

You may not have exposure to some specific topics in OCPJP 7, such as IO fundamentals and NIO.2, JDBC, localization, or multi-threading. Naturally, you have to prepare more for these topics.  

How do you know what specific topics to prepare for? 

A qualitative (and naive approach that is likely to work) is to rate yourself on each exam topic in the scale of 0 to 10 where 0 stands for no knowledge, and 10 stands for very good knowledge. Order the topics in ascending order and now you have a prioritized list of topics to prepare. 

A quantitative (and more grounded approach that works for sure) is to take one or two sample tests, and create a prioritized list of topics based on the topics based on your score. This is the approach we have recommended in the pre-test (Chapter II) in our book. 
  
4. Do you have any insights gained for effective OCPJP 7 exam preparation?  

Yes! During our exam preparation, taking the exam, and writing the book we had a few "Aha!" moments where we got some insights that could help you in effective preparation for cracking the OCPJP 7 exam!

Our first insight is about kind of exam questions in OCPJP 7 exam. Reflecting on our experience in taking the exam, we realized that specific OCPJP 7 exam topics had more conceptual questions, and few other specific exam topics had more programming-based questions. Immediately after taking our exams, we started working on preparing the mock tests. While trying to coming-up with questions, we found that it is easier to come up with conceptual questions for certain topics and natural to come up with programming questions for certain topics! 

We'll illustrate this with two simple examples. For the exam sub-topics such as "Develop code that implements "is-a" and/or "has-a" relationship" and "Define the layout of the JDBC API", it is easier to ask or create conceptual questions. Now consider these two sub-topics: "Use java.util.concurrent collections" and "Search, parse, and replace strings by using regular expressions, using expression patterns for matching limited to: . (dot), * (star), + (plus), ?, \d, \D, \s, \S, \w, \W, \b. \B, [], ()." For these two topics, asking programming questions is easy!   

This experience was in sync with our experience taking the exam! In general, "Object-Oriented Design Principles" is the topic in which you're likely to get almost all questions to be conceptual questions, whereas "String Processing" is a topic where you're likely to get almost all the questions to be programming-based questions. As you can see, for top-level topics it is difficult to make such a distinction, but for sub-topics it is easy to make such differentiation. 

So what does this insight help you in exam preparation? When you look for a sub-topic, just think what kind of questions you're likely to get - and prepare based on that! 

Our second insight is about the distribution of the questions within and across exam topics. When we started, we somehow assumed that the questions will be equally distributed across all the exam topics (e.g., equally distributed among 12 topics in  IZ0-804). However, when taking our exam we realized that there are more questions in certain topics than others topics! In other words, questions are not equally distributed among exam topics. If you look at Oracle's website for OCPJP exam, it is mentioned nowhere that exam questions will be equally distributed among the exam topics (if you saw, please let us know!). 

When preparing mock tests, we realized that it is easier to create questions on topics such as regular expressions and collections, but difficult to create questions in topics such as design patterns, and sub-topics such as "Watch a directory for changes by using WatchService" and "Create custom exceptions". For example, we didn't get any questions on "custom exceptions" when we took the exam, but got quite a few programming-based questions on regular expressions, glob in NIO.2, custom date and time formats in locales.    

So, what does this insight help you when you prepare for the exam? Just think what kind of questions can one create for an exam topic. If it is difficult for you to mentally create possible questions on an exam topic, it is likely that you may not get such questions in the exam!  

Our third insight is on ambiguous questions. When we prepared for the exam and created mock-test (Chapter II in our book), we somehow assumed that the questions in actual exam would be unambiguous, completely self-descriptive or self-contained. However, when we took the exam, it wasn't so: some questions were ambiguous, not so self-descriptive that we had to assume some context, or imagine some missing aspects that the person who had created the exam assumed. Surprising but true! Since we wanted our mock tests (appendix II and III in our book) to be as close to the exam taking experience as possible, we designed our mock tests the same way. Of course, the downside of the approach we have taken is that readers (i.e., you) may complain that we have not done a good job, but that's a conscious risk we took! 

So, what does this insight help you when you prepare for the exam? Don't naively assume that the exam questions will be perfect, unambiguous, or completely free of the possibility for subjective interpretation. If you have that assumption before you go to take the exam, you may be frustrated when you don't find that "perfect exam" that you imagined. When you prepare for the exam with an understanding that questions may not be "perfect", that allows you for more effective exam preparation - you'll be prepared to do some guesswork during the actual exam! 
  
Our last insight is on writing sample code for exam preparation. During our exam preparation as well as writing the book, we used both Eclipse IDE as well as command-line for trying out sample programs. And we noticed something interesting: We got better understanding of certain language and API details when we used command-line than when using GUI! That's unusual, right, but why? 

One reason is that when we made mistakes in the program code, it took more time for us to realize that there was a compiler error (since edit-compile-reedit takes longer when working in command-line). Eclipse would immediately identify the mistake and high-light warnings and errors, and so we would immediately fix them without giving considerable thought to it. Since exam preparation is more about understanding than productivity, we started using command-line more than IDE. 

Another reason why using command-line works better than using an IDE is this: without help from IDE in showing the methods, or the arguments, or the type of the arguments, we had to more carefully remember, look-up, or understand the API documentation. Eclipse makes us lazy about learning and remembering API method details. Understanding and remembering key API details is especially important from exam perspective. 

There are few more reasons, such as being more careful and attentive while writing code (since its more time consuming when we make mistakes) which we don't discuss here, and if you think about it, it is easy to understand why.

One last point: We found javac's -Xprint option to be especially useful. For example, we always get confused about exact differences between Comparator and Comparable, Runnable and Callable, etc. When in doubt we would quickly type them in console to recollect the differences. For example: 

$ javac -Xprint java.lang.Comparable
package java.lang;

public interface Comparable<T> {
  int compareTo(T arg0);
}

$ javac -Xprint java.util.Comparator
package java.util;

public interface Comparator<T> {

  int compare(T arg0,
    T arg1);

  boolean equals(java.lang.Object arg0);
}
$

That's quite handy instead of looking up in Eclipse or Java documentation, right? 

Don't get us wrong: We are not against Eclipse or any other IDE. What we are just saying is that we found using command-line especially useful from exam perspective. So, if you're using only an IDE consider using command-line.  

So, what does this insight help you when you prepare for the exam? If you use command-line for trying out sample programs for exam preparation, you're likely to be more attentive during the exam, get better knowledge and understanding of APIs, which will improve your chances of cracking the exam! 

Got any questions? Feel free to post your question as a comment to this blog post.