1Z0-830 Exam Details

  • Exam Code
    :1Z0-830
  • Exam Name
    :Java SE 21 Developer Professional
  • Certification
    :Oracle Certifications
  • Vendor
    :Oracle
  • Total Questions
    :95 Q&As
  • Last Updated
    :Jul 09, 2026

Oracle 1Z0-830 Online Questions & Answers

  • Question 11:

    Given:

    java

    var array1 = new String[]{ "foo", "bar", "buz" };

    var array2[] = { "foo", "bar", "buz" };

    var array3 = new String[3] { "foo", "bar", "buz" };

    var array4 = { "foo", "bar", "buz" };

    String array5[] = new String[]{ "foo", "bar", "buz" };

    Which arrays compile? (Select 2)

    A. array1
    B. array2
    C. array3
    D. array4
    E. array5

  • Question 12:

    What is the output?

    record R(int x) implements AutoCloseable {

    public void close() { System.out.print("close "); }

    }

    try (R r = new R(1)) {

    System.out.print("run ");

    } finally {

    System.out.print("finally ");

    }

    A. run finally
    B. close run finally
    C. run close finally
    D. run finally close

  • Question 13:

    Given:

    java

    interface Calculable {

    long calculate(int i);

    }

    public class Test {

    public static void main(String[] args) {

    Calculable c1 = i -> i + 1; // Line 1

    Calculable c2 = i -> Long.valueOf(i); // Line 2

    Calculable c3 = i -> { throw new ArithmeticException(); }; // Line 3 }

    }

    Which lines fail to compile?

    A. Line 1 and line 3
    B. Line 2 only
    C. Line 1 only
    D. Line 1 and line 2
    E. Line 2 and line 3
    F. Line 3 only
    G. The program successfully compiles

  • Question 14:

    What do the following print?

    java

    public class DefaultAndStaticMethods {

    public static void main(String[] args) {

    WithStaticMethod.print();

    }

    }

    interface WithDefaultMethod {

    default void print() {

    System.out.print("default");

    } } interface WithStaticMethod extends WithDefaultMethod { static void print() { System.out.print("static"); } }

    A. nothing
    B. default
    C. Compilation fails
    D. static

  • Question 15:

    Given:

    java

    Integer frenchRevolution = 1789;

    Object o1 = new String("1789");

    Object o2 = frenchRevolution;

    frenchRevolution = null;

    Object o3 = o2.toString();

    System.out.println(o1.equals(o3));

    What is printed?

    A. true
    B. false
    C. A NullPointerException is thrown.
    D. A ClassCastException is thrown.
    E. Compilation fails.

  • Question 16:

    Given:

    java

    package vehicule.parent;

    public class Car {

    protected String brand = "Peugeot";

    }

    and

    java

    package vehicule.child;

    import vehicule.parent.Car;

    public class MiniVan extends Car {

    public static void main(String[] args) {

    Car car = new Car();

    car.brand = "Peugeot 807";

    System.out.println(car.brand);

    }

    }

    What is printed?

    A. Peugeot
    B. Peugeot 807
    C. An exception is thrown at runtime.
    D. Compilation fails.

  • Question 17:

    Given:

    java

    var deque = new ArrayDeque<>();

    deque.add(1);

    deque.add(2);

    deque.add(3);

    deque.add(4);

    deque.add(5);

    System.out.print(deque.peek() + " ");

    System.out.print(deque.poll() + " ");

    System.out.print(deque.pop() + " ");

    System.out.print(deque.element() + " ");

    What is printed?

    A. 1 1 1 1
    B. 1 5 5 1
    C. 1 1 2 3
    D. 1 1 2 2
    E. 5 5 2 3

  • Question 18:

    Given:

    java

    String colors = "red\n" +

    "green\n" +

    "blue\n";

    Which text block can replace the above code?

    A. java String colors = """ red \ green\ blue \ """;
    B. java String colors = """ red \s green\s blue \s """;
    C. java String colors = """ red \t green\t blue \t """;
    D. java String colors = """ red green blue """;
    E. None of the propositions

  • Question 19:

    You are working on a module named perfumery.shop that depends on another module named perfumery.

    provider.

    The perfumery.shop module should also make its package perfumery.shop.eaudeparfum available to other modules.

    Which of the following is the correct file to declare the perfumery.shop module?

    A. File name: module-info.perfumery.shop.java java module perfumery.shop { requires perfumery.provider; exports perfumery.shop.eaudeparfum.*; }
    B. File name: module-info.java java module perfumery.shop { requires perfumery.provider; exports perfumery.shop.eaudeparfum; }
    C. File name: module.java java module shop.perfumery { requires perfumery.provider; exports perfumery.shop.eaudeparfum; }

  • Question 20:

    Given:

    java

    final Stream strings =

    Files.readAllLines(Paths.get("orders.csv"));

    strings.skip(1)

    .limit(2)

    .forEach(System.out::println);

    And that the orders.csv file contains:

    mathematica

    OrderID,Customer,Product,Quantity,Price

    2,Teddy Riner,Mouse,1,15.99

    3,Sebastien Loeb,Monitor,1,199.99

    4,Antoine Griezmann,Headset,3,45.00

    What is printed?

    A. arduino 2,Teddy Riner,Mouse,1,15.99 3,Sebastien Loeb,Monitor,1,199.99 4,Antoine Griezmann,Headset,3,45.00
    B. arduino 2,Teddy Riner,Mouse,1,15.99
    C. arduino 2,Teddy Riner,Mouse,1,15.99 3,Sebastien Loeb,Monitor,1,199.99
    D. An exception is thrown at runtime.
    E. Compilation fails.

Tips on How to Prepare for the Exams

Nowadays, the certification exams become more and more important and required by more and more enterprises when applying for a job. But how to prepare for the exam effectively? How to prepare for the exam in a short time with less efforts? How to get a ideal result and how to find the most reliable resources? Here on Vcedump.com, you will find all the answers. Vcedump.com provide not only Oracle exam questions, answers and explanations but also complete assistance on your exam preparation and certification application. If you are confused on your 1Z0-830 exam preparations and Oracle certification application, do not hesitate to visit our Vcedump.com to find your solutions here.