Question

When I practice to take the OCJP exam, I see that the questions that I'm suppose to practice on are often trick questions which try to fool my into answering wrong. The example is from the Bathes / Sierra book and a typical trick question is:

enter image description here

Now I wonder if you can tell me if the questions on the real exam also often are trick questions like these or if the actual exam has another style, or if this is close to what I should expect?

Was it helpful?

Solution

The given example is not tricky. It simply measures that whether you know the difference between constructors and methods. Constructors and methods might have the same name, it is not a compilation error.

The exam may contain questions like these to trip up the participants. However, you should keep in mind that every question in the exam is just for measuring your ability and knowledge in certain exam objectives. You should ask yourself while reading the question: "What objective might this question be measuring?"

OTHER TIPS

Now I wonder if you can tell me if the questions on the real exam also often are trick questions like these or if the actual exam has another style, or if this is close to what I should expect?

The point of grilling you through such questions is to help you get your defenses up. This is not a trick question like @Juvanis has pointed out, but such questions will help you develop a pattern to identify faults in code. Usually a pattern begins to emerge and your brain starts to analyze the code like so...

  1. Do all the necessary imports exist and are they correct ?
  2. Are non-static variables accessed from a static context ?
  3. Check method return values and return type.
  4. Check autoboxing / unboxing errors.
  5. ... and so on

The real exam is easier. However if you prepare with harder questions, the chances of succeeding are better.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top