All Practice Exams

100+ Free Java SE 8 Programmer II Practice Questions

Pass your Oracle Certified Professional, Java SE 8 Programmer II (Exam 1Z0-809) exam on the first try — instant access, no signup required.

✓ No registration✓ No credit card✓ No hidden fees✓ Start practicing immediately
100+ Questions
100% Free
1 / 100
Question 1
Score: 0/0

What does the following print? Stream.of("a","b","c") .peek(System.out::print) .map(String::toUpperCase) .findFirst();

A
B
C
D
to track
2026 Statistics

Key Facts: Java SE 8 Programmer II Exam

$245

Exam Fee (USD)

Oracle

65%

Passing Score

Oracle

150 min

Time Limit

Oracle

~68

Question Count

Oracle

No expiry

Credential Validity

Oracle

1Z0-808

Required co-credential for OCP

Oracle

Oracle lists Exam 1Z0-809 (Java SE 8 Programmer II) as a professional-level certification delivered through Pearson VUE, with a 65% passing score, about 68 multiple-choice and multiple-select questions, a 150-minute time limit, and a $245 USD fee; the credential does not expire. The blueprint spans Java class design, advanced class design, generics and collections, lambda built-in functional interfaces, the Stream API, exceptions and assertions, the Date/Time API, I/O fundamentals, NIO.2 file I/O, concurrency, JDBC, and localization. The OCA 1Z0-808 credential is required to be awarded the full OCP designation.

Sample Java SE 8 Programmer II Practice Questions

Try these sample questions to test your Java SE 8 Programmer II exam readiness. Each question includes a detailed explanation. Start the interactive quiz above for the full 100+ question experience with AI tutoring.

1Given: class Animal { String speak() { return "..."; } } class Dog extends Animal { @Override String speak() { return "Woof"; } } Animal a = new Dog(); String s = a.speak(); What is the value of s, and why?
A."Woof" because virtual method invocation uses the runtime type Dog
B."..." because the declared type Animal determines which method runs
C.A compile error because speak() is package-private and cannot be overridden
D."Woof" only if speak() is declared public in both classes
Explanation: Instance methods are dispatched using the runtime (actual) type of the object, not the declared reference type. This is polymorphism via virtual method invocation, so a.speak() calls Dog.speak() and returns "Woof".
2Which set of characteristics correctly describes a properly implemented immutable class in Java?
A.Fields are private and non-final; setters return defensive copies
B.The class is final, all fields are private and final, no setters exist, and mutable fields are defensively copied in the constructor and getters
C.All fields are public final so they cannot be reassigned by callers
D.The class implements Cloneable and overrides clone() to return shallow copies
Explanation: An immutable class prevents state changes after construction: make the class final so it cannot be subclassed, make all fields private and final, provide no mutators, and defensively copy any mutable referenced objects both when storing them and when returning them. This guarantees the observable state never changes.
3Given a thread-safe singleton implemented with an enum: public enum Config { INSTANCE; private int v = 1; } Which statement about this pattern is TRUE?
A.It is not thread-safe because enum constants are initialized lazily on each access
B.It requires an explicit synchronized getInstance() method to be safe
C.It provides serialization safety and guards against reflection-based instantiation automatically
D.It cannot hold mutable instance fields like v
Explanation: The enum singleton is the most robust singleton form: the JVM guarantees a single instance, enum serialization is handled specially so deserialization returns the same constant, and the language forbids reflective instantiation of enums. No synchronization or readResolve is needed.
4Given: class Base { Base() { init(); } void init() { System.out.print("B"); } } class Sub extends Base { int x = 5; void init() { System.out.print(x); } } What does new Sub() print?
A.5
B.B5
C.B
D.0
Explanation: The Base constructor runs before Sub's instance initializers, so when the overridden init() executes during super-construction, x has not yet been assigned 5; it still holds its default value 0. This is the classic 'calling overridable methods from a constructor' pitfall.
5An overriding method in a subclass may legally do which of the following relative to the method it overrides?
A.Declare a broader (less restrictive) access modifier and throw fewer checked exceptions
B.Declare a narrower (more restrictive) access modifier such as private over protected
C.Add new checked exceptions not declared by the superclass method
D.Return a supertype of the original return type
Explanation: Overriding rules allow widening access (e.g., protected to public) and allow throwing the same, fewer, or narrower checked exceptions, including none. Return types may be covariant (a subtype of the original).
6Given: class A { static String who() { return "A"; } } class B extends A { static String who() { return "B"; } } A ref = new B(); String s = ref.who(); What is s?
A."B" because of polymorphic dispatch
B."A" because static methods are hidden, not overridden, and are resolved by the reference's compile-time type
C.A compile error because static methods cannot share a name across subclasses
D."A" or "B" depending on the JVM
Explanation: Static methods are not polymorphic; a subclass static method with the same signature hides the superclass one. Resolution uses the declared (compile-time) type of the reference, which is A, so A.who() runs and returns "A".
7What is the primary purpose of overriding both equals(Object) and hashCode() together when a class is used as a HashMap key?
A.To allow the keys to be sorted in natural order
B.To make the class immutable automatically
C.To honor the contract that equal objects must produce equal hash codes, so lookups land in the correct bucket and match
D.To enable the keys to be serialized correctly
Explanation: HashMap first uses hashCode() to pick a bucket, then equals() to find the matching entry within that bucket. The contract requires that objects equal by equals() have identical hashCode() values; violating it makes a previously stored value unfindable.
8Given two interfaces with the SAME default method signature: interface X { default String id() { return "X"; } } interface Y { default String id() { return "Y"; } } class C implements X, Y { } What happens?
A.C compiles and id() returns "X" because X is listed first
B.C fails to compile and the conflict cannot be resolved at all
C.C compiles and id() returns "Y" because Y is the most recently declared
D.C fails to compile unless it overrides id(), and it may call X.super.id() or Y.super.id() inside the override
Explanation: When a class inherits two default methods with the same signature from unrelated interfaces, the compiler reports an ambiguity. The class must override id(); inside that override it can delegate explicitly with X.super.id() or Y.super.id().
9Which statement about an abstract class in Java SE 8 is TRUE?
A.An abstract class may contain zero abstract methods and still be declared abstract
B.An abstract class cannot declare constructors
C.An abstract class cannot have instance fields
D.An abstract class must be implemented with the 'implements' keyword
Explanation: A class may be declared abstract even if it has no abstract methods; the abstract modifier simply prevents direct instantiation. Abstract classes may have constructors (called via super), instance fields, and concrete methods.
10Given: enum Planet { EARTH(9.8), MARS(3.7); private final double g; Planet(double g){this.g=g;} double gravity(){return g;} } Which statement is TRUE?
A.The enum constructor must be public to set the g field
B.Each constant can supply constructor arguments, and the constructor is implicitly private
C.Calling Planet.values() returns a Set of the constants
D.The constants EARTH and MARS can be reassigned at runtime
Explanation: Enum constants may pass arguments to a constructor, which is implicitly (and can only be) private or package-private. The compiler invokes it once per constant. values() returns an array, and constants are implicitly final and cannot be reassigned.

About the Java SE 8 Programmer II Exam

Exam 1Z0-809 leads to the Oracle Certified Professional, Java SE 8 Programmer II credential, the advanced second-level Java 8 certification that follows the OCA 1Z0-808 associate exam. It validates deep, applied knowledge of the Java SE 8 language and core APIs: object-oriented and advanced class design, generics and collections, lambda expressions and built-in functional interfaces, the Stream API, exceptions and assertions, the java.time Date/Time API, I/O and NIO.2 file handling, concurrency, JDBC, and localization. Questions are heavily code-based, asking candidates to determine compilation results, runtime output, and the correct API to apply. The professional exam is notably harder than 1Z0-808, emphasizing functional programming, streams, and concurrency.

Questions

68 scored questions

Time Limit

150 minutes

Passing Score

65%

Exam Fee

$245 (Oracle)

Java SE 8 Programmer II Exam Content Outline

13%

Java Class Design

Apply encapsulation, inheritance, and polymorphism; understand virtual method invocation and method hiding for statics; implement singletons (including the enum singleton), immutable classes with defensive copies, and correct equals/hashCode contracts for hash-based collections.

10%

Advanced Java Class Design

Use abstract classes and interfaces (including default and static methods and the diamond-conflict resolution rule), enums with fields and constructors, nested and inner classes with effectively-final capture, and single-abstract-method functional interfaces as lambda targets.

14%

Generics and Collections

Create type-safe collections, apply bounded type parameters and upper/lower wildcards following PECS, leverage generic methods, sort with Comparator chains and Comparable, and use Map, List, Set, Deque, NavigableMap, and method references.

8%

Lambda Built-in Functional Interfaces

Select and compose the built-in interfaces Predicate, Supplier, Consumer, Function, UnaryOperator, BinaryOperator, BiFunction, and their primitive specializations, and chain behavior with andThen, compose, and negate to avoid autoboxing where possible.

12%

Java Stream API

Build lazy pipelines with filter, map, flatMap, peek, sorted, and limit; terminate with reduce, collect, count, findFirst, and findAny; use Optional safely; and apply Collectors such as groupingBy, partitioningBy, toMap, and joining, plus parallel-stream correctness rules.

6%

Exceptions and Assertions

Use try-with-resources (reverse-order closing and suppressed exceptions), multi-catch with its implicitly-final parameter, custom checked and unchecked exceptions, finally control-flow precedence, and assertions enabled with -ea for internal invariants.

7%

Use Java SE 8 Date/Time API

Work with the immutable java.time types LocalDate, LocalTime, LocalDateTime, and ZonedDateTime; distinguish date-based Period from time-based Duration; compute signed spans with ChronoUnit; and format and parse with DateTimeFormatter.

6%

Java I/O Fundamentals

Read and write data with byte streams and character readers/writers, apply buffering for performance, use System.console safely (it can return null), and serialize objects with Serializable while handling transient and static fields.

8%

Java File I/O (NIO.2)

Use the Path and Files APIs to resolve, relativize, normalize, and inspect paths; copy and move files with StandardCopyOption; and lazily stream the file tree and content with Files.walk, Files.find, and Files.lines inside try-with-resources.

11%

Java Concurrency

Start threads correctly with start(); use ExecutorService, Callable, and Future; apply concurrent collections (ConcurrentHashMap, CopyOnWriteArrayList) and atomics; coordinate with CyclicBarrier and CountDownLatch; parallelize with Fork/Join; and reason about volatile visibility and deadlock.

3%

Building Database Applications with JDBC

Obtain connections through auto-registered JDBC 4.0 drivers, run parameterized PreparedStatements to block SQL injection, advance and read ResultSet cursors correctly, and close Connection, Statement, and ResultSet with try-with-resources.

2%

Localization

Build locale-aware applications with Locale and ResourceBundle (including the most-specific-to-base fallback chain) and format numbers and currency per locale with NumberFormat.

How to Pass the Java SE 8 Programmer II Exam

What You Need to Know

  • Passing score: 65%
  • Exam length: 68 questions
  • Time limit: 150 minutes
  • Exam fee: $245

Keys to Passing

  • Complete 500+ practice questions
  • Score 80%+ consistently before scheduling
  • Focus on highest-weighted sections
  • Use our AI tutor for tough concepts

Java SE 8 Programmer II Study Tips from Top Performers

1Compile and run every concept yourself; the exam asks you to predict output and whether code compiles, so passive reading is not enough for streams, generics, and concurrency.
2Master streams end to end: intermediate vs terminal operations, laziness and short-circuiting, Optional, and Collectors such as groupingBy, partitioningBy, toMap, and joining.
3Internalize generics and PECS (Producer Extends, Consumer Super); know why you cannot add to a List<? extends T> and can add to a List<? super T>.
4Treat all java.time types as immutable: methods like plusDays return a new object, and forgetting to capture the result is a frequent trap.
5Practice NIO.2 Path arithmetic by hand: resolve returns an absolute argument unchanged, relativize builds the path between two locations, and normalize cancels . and .. syntactically.
6Get comfortable with concurrency primitives: ExecutorService and Future, ConcurrentHashMap, atomics, CyclicBarrier vs CountDownLatch, Fork/Join fork-then-compute-then-join, and the volatile visibility guarantee.

Frequently Asked Questions

What are the current exam facts for 1Z0-809?

Oracle lists Exam 1Z0-809 as a professional-level certification with a 65% passing score and a $245 USD fee, delivered through Pearson VUE. It presents about 68 multiple-choice and multiple-select questions in 150 minutes, and the credential does not expire.

How is 1Z0-809 different from 1Z0-808?

1Z0-808 is the OCA associate exam covering Java fundamentals, while 1Z0-809 is the professional second-level exam. The Programmer II exam is considerably harder, going deep into lambdas, the Stream API, generics, NIO.2, and concurrency, with intricate code-output and compile questions.

Do I need to pass 1Z0-808 before 1Z0-809?

You can sit 1Z0-809 on its own, but to be awarded the Oracle Certified Professional, Java SE 8 Programmer credential you must also hold the OCA Java SE 8 (1Z0-808) certification. Many candidates take 1Z0-808 first.

Which topics carry the most weight on 1Z0-809?

Generics and Collections, the Stream API, and Concurrency together make up a large share of the exam and are where most candidates lose points. Expect many questions on wildcards and PECS, stream pipelines and collectors, and the Executor and Fork/Join frameworks.

Does the OCP Java SE 8 certification expire?

No. Once you earn the Oracle Certified Professional, Java SE 8 Programmer credential it does not expire. Oracle's role-based renewal policies apply only to certain other certifications, not this one.

What is the best way to prepare for 1Z0-809?

Write and run real Java 8 code rather than only reading. Drill stream pipelines, generics wildcards, java.time immutability, NIO.2 Path resolve/relativize/normalize, and multithreaded examples until you can predict compilation and output reliably.