DEV Community

ExamCert.App
ExamCert.App

Posted on

7 Java Traps That Wreck 1Z0-808 Candidates — Work Through These Before You Book (oracle-1z0-808 practice questions free)

Oracle Java SE 8 Programmer I (1Z0-808)

You've written Java for three years. You open a 1Z0-808 practice set expecting a warm-up and score 55%.

This happens constantly, and it's not a knowledge problem — it's a compiler problem. Your IDE has been catching things for you for years. The exam gives you plain text and asks what happens, and "the answer is: it doesn't compile" turns out to be correct more often than anyone expects.

Below are the seven traps that account for most of the damage. Grab some oracle-1z0-808 practice questions free and work these until they're boring, because every one of them shows up in some disguise.

The exam, briefly

  • 56 questions, multiple choice and multi-select
  • 150 minutes
  • 65% to pass (that's ~37 correct)
  • $245 USD
  • Java SE 8. Yes, 8. Not 17, not 21. The exam is written against 8 and the answer that's correct in Java 8 is the correct answer even if a later version changed it.

That version pinning matters. Don't argue with the exam about var.


Trap 1: local variables aren't initialised, and the compiler cares

public void run() {
    int x;
    if (someCondition) { x = 5; }
    System.out.println(x); // does not compile
}
Enter fullscreen mode Exit fullscreen mode

Instance fields default to 0 / null / false. Local variables do not. The compiler performs definite-assignment analysis and rejects any path where the variable might be unassigned — even if you can prove at runtime it'd always be set.

Expect at least one question that looks like a logic puzzle but is really this.

Trap 2: integer division and the silent narrowing rules

System.out.println(5 / 2);       // 2
System.out.println(5 / 2.0);     // 2.5
byte b = 10;
b = b + 1;                       // does not compile
b += 1;                          // compiles fine
Enter fullscreen mode Exit fullscreen mode

That last pair is the classic. b + 1 promotes to int, and assigning int to byte needs an explicit cast — but compound assignment operators do an implicit narrowing cast. Same operation, different compile result. The exam loves this.

Also know that char is numeric, char c = 'a' + 1; is legal, and integer overflow wraps silently.

Trap 3: String immutability versus StringBuilder

String s = "hello";
s.concat(" world");
System.out.println(s);           // "hello"

StringBuilder sb = new StringBuilder("hello");
sb.append(" world");
System.out.println(sb);          // "hello world"
Enter fullscreen mode Exit fullscreen mode

String methods return new objects and never mutate. Every question that calls .toUpperCase(), .trim(), .replace() or .substring() without reassigning is testing whether you noticed.

Then the string pool:

String a = "java";
String b = "java";
String c = new String("java");
a == b        // true  (pool)
a == c        // false (new object)
a.equals(c)   // true
Enter fullscreen mode Exit fullscreen mode

Trap 4: ArrayList remove overloads

List<Integer> nums = new ArrayList<>(List.of(10, 20, 30));
nums.remove(1);                       // removes INDEX 1 → [10, 30]
nums.remove(Integer.valueOf(10));     // removes the OBJECT 10 → [20, 30]
Enter fullscreen mode Exit fullscreen mode

remove(int) and remove(Object) are different overloads, and with a List<Integer> both compile. This is one of the most reliably fatal traps in the whole exam.

Trap 5: pass-by-value, always

Java is pass-by-value. Full stop. The confusion is that for objects, the value being passed is the reference.

void mutate(StringBuilder sb, String s) {
    sb.append(" changed");   // caller sees this
    s = s + " changed";      // caller does NOT see this
}
Enter fullscreen mode Exit fullscreen mode

You can mutate the object a reference points to. You cannot repoint the caller's variable. Every "what does this print" question involving a method call is checking this distinction.

Trap 6: switch, fall-through, and what's allowed as a label

int day = 2;
switch (day) {
    case 1: System.out.println("Mon");
    case 2: System.out.println("Tue");   // prints
    case 3: System.out.println("Wed");   // ALSO prints — no break
    default: System.out.println("Other"); // ALSO prints
}
Enter fullscreen mode Exit fullscreen mode

Missing break means fall-through, and the exam will absolutely give you a switch with breaks in some cases and not others.

Also: in Java 8, a switch works on byte, short, char, int, their wrappers, String, and enums. Not long, not double, not boolean. Case labels must be compile-time constants.

Trap 7: inheritance, overriding, and access modifiers

class Parent {
    protected Object doThing() { return null; }
}
class Child extends Parent {
    private String doThing() { return "x"; }  // does not compile
}
Enter fullscreen mode Exit fullscreen mode

An override cannot reduce visibility. It can widen it. The return type can be covariant (String for Object is fine) — the killer here is private.

Then the static/instance distinction:

Parent p = new Child();
p.instanceMethod();   // Child's version — runtime polymorphism
p.staticMethod();     // Parent's version — static methods are HIDDEN, not overridden
p.field;              // Parent's field — fields are hidden too
Enter fullscreen mode Exit fullscreen mode

Overriding applies to instance methods only. Static methods and fields resolve by the reference type, not the object type. Half the tricky output questions on this exam live right here.


Bonus: the Java 8 additions they actually test

1Z0-808 includes lambdas and predicates, but lightly — mostly Predicate<T> with test(), basic lambda syntax, and where the target type comes from. Don't go deep on streams; that's the 809/1Z0-819 territory.

Do know the date/time API though: LocalDate, LocalTime, LocalDateTime, Period. And know that these are immutable too:

LocalDate d = LocalDate.of(2026, 8, 5);
d.plusDays(10);
System.out.println(d);    // still 2026-08-05
Enter fullscreen mode Exit fullscreen mode

Same immutability trap as String, new API.


How to actually prepare

Stop using an IDE. Seriously — for a few weeks, write your practice code in a text editor and compile with javac from the terminal. The whole exam is "will this compile," and IntelliJ has been answering that question for you silently for years.

Then it's question volume. I worked through free Oracle 1Z0-808 practice questions in 20-question blocks, and for every wrong answer I typed the code out and compiled it to see the real error. Predict → compile → compare. That loop is what rewires the instinct.

Four to six weeks is enough for a working developer. Longer if Java's not your daily language.

  • Week 1: basics, data types, operators, definite assignment
  • Week 2: flow control, arrays, ArrayList
  • Week 3: methods, encapsulation, pass-by-value semantics
  • Week 4: inheritance, polymorphism, interfaces, abstract classes
  • Week 5: exceptions, String/StringBuilder, date-time, lambdas
  • Week 6: timed full sets only

Drilling on ExamCert with the rationale visible beats re-reading a certification textbook, and when a compile error doesn't make sense, ai.examcert.app explains the specific rule being violated — much faster than searching the JLS.

Is it worth it?

For a junior developer or a career-changer, yes — it's a concrete, permanent (no expiry) signal that you know the language rather than one framework built on it. For a senior engineer, it's mostly a box-tick, though a surprising number of consultancies and government contracts require it.

Either way: pull up some free 1Z0-808 practice questions and try 20 cold. If you're a working Java dev and you don't score at least 70%, that gap is exactly the seven traps above.

Top comments (0)