oracle released the OCA Java 8 Programmer I exam today

Oracle released the OCA Java SE 8 Programmer I certification today. There are 77 questions and you get 2 hours to take the exam. The passing score is 65%. The topics have not changed since the beta.

You may already know that Scott and I wrote a study guide for this exam. The Kindle edition is already out. As of January 8th, the publisher was still working on posting the downloadable materials (3 mock exams, flashcards and glossary) that go with it. You can download those once they become available if you’ve bought the Kindle edition (or hard copy.) The hard copy is available for pre-order, but has not yet shipped.

We look forward to seeing your comment and questions in the OCAJP forum at CodeRanch. Also, you can see our book page for any errata or updates about the exam.

 

Eclipse – easily looking at Java bytecode

A fellow moderator asked me to weigh in on this question at CodeRanch. The gist is whether this code creates one String or two:

String s = " " + 3;

How to find out the answer

The most definitive way to verify this is to check the bytecode. I had downloaded the bytecode plugin when working on our Java 8 OCA Study Guide because sometimes you just have to know what actually goes on behind the scenes to be accurate.

Using the plugin is easy. You go to Window -> Show View -> Other -> Java -> Bytecode. Then every time you save the Java file, the bytecode window is automatically updated. Great for lots of iterations.

The test

I wrote a simple Java class:

package jb;
public class PlayTest {
  public static void main(String[] args) {
    String s = "" + 3;
  }
}

The generated bytecode is:

// class version 52.0 (52)
// access flags 0x21
public class jb/PlayTest {

  // compiled from: PlayTest.java

  // access flags 0x1
  public <init>()V
   L0
    LINENUMBER 4 L0
    ALOAD 0
    INVOKESPECIAL java/lang/Object.<init> ()V
    RETURN
   L1
    LOCALVARIABLE this Ljb/PlayTest; L0 L1 0
    MAXSTACK = 1
    MAXLOCALS = 1

  // access flags 0x9
  public static main([Ljava/lang/String;)V
   L0
    LINENUMBER 8 L0
    LDC "3"
    ASTORE 1
   L1
    LINENUMBER 14 L1
    RETURN
   L2
    LOCALVARIABLE args [Ljava/lang/String; L0 L2 0
    LOCALVARIABLE s Ljava/lang/String; L1 L2 1
    MAXSTACK = 1
    MAXLOCALS = 2
}

finding out when Oracle changes the certification objectives

As Scott and I noted in the introduction of our book, Oracle tends to fiddle with the duration, number of questions and passing score of their certification exams. They also fiddle with the exam objectives themselves on occasion. And as you might imagine, these aren’t well publicized.

First attempt

I originally thought that I would use the ChangeDetection service to subscribe to receive an email when the relevant certification pages changed. This turned out not to work as the HTML is always the same. Oracle uses AJAX to fill in the data. For example, the objectives page for the OCA 8 is rendered using the XML on this page. My next thought was that I’d use the ChangeDetection site to monitor the XML page. No such luck, they don’t support XML.

Writing something myself

A differences program isn’t hard to write, so I created my own in a public github repository. It stores a copy of the “current” data for each exam it follows and checks for differences. (I have it running as a Jenkins periodic build so it checks for updates once a day.) I considered using Travis CI since it supports Java/Maven. However, Travis doesn’t yet support periodic builds. There is a third party site that can trigger your builds for you, but CodeRanch has a perfectly good Jenkins server. And since one of the goals of this project is to be able to announce certification changes on a timely basis in the forums, it seems reasonable to run it there.

How do you find out if there is a change?

For significant changes, we tend to mention them in the relevant certification forum. For the OCA 8 exam, we will also list objective changes on the book page. You can also look at the text files for each exam on github. The last modified date shows the last change. You can also click on the file to see the history/diffs to see what changed and approximately cool. You could even use the ChangeDetection service on the github pages since they aren’t XML. For example, this page is for the OCA 8.

If there is an exam you’d find useful to be tracked and isn’t already, please add a comment on this blog post.

Technologies used

  1. Maven
  2. Selenium (a tiny bit)
  3. HTML Parser
  4. JUnit/Parameterized test