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 31:

    Given:

    java

    String s = " ";

    System.out.print("[" + s.strip());

    s = " hello ";

    System.out.print("," + s.strip());

    s = "h i ";

    System.out.print("," + s.strip() + "]");

    What is printed?

    A. [ ,hello,h i]
    B. [,hello,h i]
    C. [,hello,hi]
    D. [ , hello ,hi ]

  • Question 32:

    What does the following code print?

    java

    import java.util.stream.Stream;

    public class StreamReduce {

    public static void main(String[] args) {

    Stream stream = Stream.of("J", "a", "v", "a");

    System.out.print(stream.reduce(String::concat));

    }

    }

    A. Optional[Java]
    B. Java
    C. null
    D. Compilation fails

  • Question 33:

    Given:

    java

    String textBlock = """

    j \

    a \t

    v \s

    a \

    """;

    System.out.println(textBlock.length());

    What is the output?

    A. 11
    B. 12
    C. 14
    D. 10

  • Question 34:

    What is the output of the following snippet? (Assume the file exists)

    java

    Path path = Paths.get("C:\\home\\joe\\foo");

    System.out.println(path.getName(0));

    A. C:
    B. IllegalArgumentException
    C. C
    D. Compilation error
    E. home

  • Question 35:

    Given:

    java

    DoubleSummaryStatistics stats1 = new DoubleSummaryStatistics();

    stats1.accept(4.5);

    stats1.accept(6.0);

    DoubleSummaryStatistics stats2 = new DoubleSummaryStatistics();

    stats2.accept(3.0);

    stats2.accept(8.5);

    stats1.combine(stats2);

    System.out.println("Sum: " + stats1.getSum() + ", Max: " + stats1.getMax() + ", Avg: " + stats1.getAverage());

    What is printed?

    A. Sum: 22.0, Max: 8.5, Avg: 5.5
    B. Sum: 22.0, Max: 8.5, Avg: 5.0
    C. An exception is thrown at runtime.
    D. Compilation fails.

  • Question 36:

    Given:

    java

    var lyrics = """

    Quand il me prend dans ses bras

    Qu'il me parle tout bas

    Je vois la vie en rose

    """;

    for ( int i = 0, int j = 3; i < j; i++ ) {

    System.out.println( lyrics.lines()

    .toList()

    .get( i ) );

    }

    What is printed?

    A. vbnet Quand il me prend dans ses bras Qu'il me parle tout bas Je vois la vie en rose
    B. Nothing
    C. An exception is thrown at runtime.
    D. Compilation fails.

  • Question 37:

    Given:

    java

    public class BoomBoom implements AutoCloseable {

    public static void main(String[] args) {

    try (BoomBoom boomBoom = new BoomBoom()) {

    System.out.print("bim ");

    throw new Exception();

    } catch (Exception e) {

    System.out.print("boom ");

    }

    }

    @Override

    public void close() throws Exception {

    System.out.print("bam ");

    throw new RuntimeException();

    }

    }

    What is printed?

    A. bim boom bam
    B. bim bam boom
    C. bim boom
    D. bim bam followed by an exception
    E. Compilation fails.

  • Question 38:

    Given:

    java

    Runnable task1 = () -> System.out.println("Executing Task-1");

    Callable task2 = () -> {

    System.out.println("Executing Task-2");

    return "Task-2 Finish.";

    };

    ExecutorService execService = Executors.newCachedThreadPool();

    // INSERT CODE HERE

    execService.awaitTermination(3, TimeUnit.SECONDS);

    execService.shutdownNow();

    Which of the following statements, inserted in the code above, prints both :

    "Executing Task-2" and "Executing Task-1"?

    A. execService.call(task1);
    B. execService.call(task2);
    C. execService.execute(task1);
    D. execService.execute(task2);
    E. execService.run(task1);
    F. execService.run(task2);
    G. execService.submit(task1);
    H. execService.submit(task2);

  • Question 39:

    Given a properties file on the classpath named Person.properties with the content:

    ini

    name=James

    And:

    java

    public class Person extends ListResourceBundle {

    protected Object[][] getContents() {

    return new Object[][]{

    {"name", "Jeanne"}

    };

    }

    }

    And:

    java

    public class Test {

    public static void main(String[] args) {

    ResourceBundle bundle = ResourceBundle.getBundle("Person");

    String name = bundle.getString("name");

    System.out.println(name);

    }

    }

    What is the given program's output?

    A. MissingResourceException
    B. Compilation fails
    C. James
    D. JeanneJames
    E. JamesJeanne
    F. Jeanne

  • Question 40:

    Given:

    java

    public class ThisCalls {

    public ThisCalls() {

    this(true);

    }

    public ThisCalls(boolean flag) {

    this();

    }

    }

    Which statement is correct?

    A. It does not compile.
    B. It throws an exception at runtime.
    C. It compiles.

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.