All free practice questions

Free practice questions

Java SE 21 Developer Professional (1Z0-830) practice questions

10 free sample questions with explanations — no account needed. When you're ready, take the full-length timed exam.

50

questions on the full exam

120 min

time limit

68%

to pass (68%)

Exam domains covered

  • Values, Text, Dates and Program Flow16%
  • Object-Oriented Concepts22%
  • Exceptions, Arrays and Collections18%
  • Streams and Lambda Expressions14%
  • Modules, Concurrency, I/O and Localization30%
Question 1Java Fundamentals: Values, Text, Dates and Program Flow

What is the output of this program?

public class Main {
    public static void main(String[] args) {
        int x = 7 / 2;
        double y = 7 / 2;
        double z = 7 / 2.0;
        System.out.println(x + ":" + y + ":" + z);
    }
}
Question 2Object-Oriented Java: Classes, Records, Inheritance and Interfaces

Which two statements are true about this code fragment?

public class Demo {
    public static void main(String[] args) {
        int base = 10;
        java.util.function.IntSupplier s = () -> base + 1;
        // line 1
        System.out.println(s.getAsInt());
    }
}

Consider line 1 independently.

Select all that apply.

Question 3Exceptions, Arrays, Collections and Generics

A developer writes this class and then calls Collections.sort(listOfScores):

class Score implements Comparable<Score> {
    int value;
    Score(int value) { this.value = value; }

    public int compareTo(Score other) {
        return value - other.value;
    }
}

Which statement is the best assessment?

Question 4Streams and Lambda Expressions

Which statements about grouping and partitioning are true?

var words = java.util.List.of("a", "to", "tea", "ten");

Select all that apply.

Select all that apply.

Question 5Modules, Concurrency, I/O and Localization

Review this descriptor pair:

// module data
module data {
    opens data.model;
}
// module report
module report {
    requires data;
}

A class in report tries to import data.model.Record and create new Record(). Record is public. What is the result?

Question 6Java Fundamentals: Values, Text, Dates and Program Flow

Which statements about java.time are true? Select all that apply.

Select all that apply.

Question 7Object-Oriented Java: Classes, Records, Inheritance and Interfaces

What is the output of this program?

class A {
    static { System.out.print("AS "); }
    { System.out.print("AI "); }
    A() { System.out.print("AC "); }
}

class B extends A {
    static { System.out.print("BS "); }
    { System.out.print("BI "); }
    B() { System.out.print("BC "); }
}

public class Test {
    public static void main(String[] args) {
        new B();
        new B();
    }
}
Question 8Exceptions, Arrays, Collections and Generics

Consider this code:

import java.util.*;

public class Test {
    public static void main(String[] args) {
        List<? extends Number> a = new ArrayList<Integer>();
        List<? super Integer> b = new ArrayList<Number>();
        List<?> c = new ArrayList<String>();
    }
}

Which statements are true?

Select all that apply.

Question 9Streams and Lambda Expressions

What happens when this code runs?

var map = java.util.stream.Stream.of("ant", "ape", "bat")
        .collect(java.util.stream.Collectors.toMap(
                s -> s.charAt(0),
                s -> s.length()));
System.out.println(map);
Question 10Modules, Concurrency, I/O and Localization

Which module-info.java for module consumer correctly states that it depends on module api and consumes service type api.spi.Parser?

What is the correct descriptor?

Get a free 1Z0-830 study plan

A 4-week plan weighted by the exam's domains, sent to your inbox, plus two short tips to keep you on track. No account needed.

Ready for the real thing?

Take a full-length, timed 50-question 1Z0-830 practice exam weighted like the official blueprint, with fresh questions each time, results by domain and a full answer review.

Inkwell practice questions are original and independent. Not affiliated with or endorsed by the certification vendor.