1Z0-816 Exam Details

  • Exam Code
    :1Z0-816
  • Exam Name
    :Java SE 11 Programmer II
  • Certification
    :Oracle Certifications
  • Vendor
    :Oracle
  • Total Questions
    :80 Q&As
  • Last Updated
    :Jun 26, 2026

Oracle 1Z0-816 Online Questions & Answers

  • Question 21:

    Which two safely validate inputs? (Choose two.)

    A. Delegate numeric range checking of values to the database.
    B. Accept only valid characters and input values.
    C. Use trusted domain-specific libraries to validate inputs.
    D. Assume inputs have already been validated.
    E. Modify the input values, as needed, to pass validation.

  • Question 22:

    Which is a proper JDBC URL?

    A. jdbe.mysql.com://localhost:3306/database
    B. http://localhost.mysql.com:3306/database
    C. http://localhost mysql.jdbc:3306/database
    D. jdbc:mysql://localhost:3306/database

  • Question 23:

    Given:

    Which is true about line 1?

    A. If the value is not present, a NoSuchElementException is thrown at run time.
    B. It always executes the System.out::print statement.
    C. If the value is not present, a NullPointerException is thrown at run time.
    D. If the value is not present, nothing is done.

  • Question 24:

    Given the contents:

    MessageBundle.properties file:

    message=Hello

    MessageBundle_en.properties file:

    message=Hello (en)

    MessageBundle_US.properties file:

    message=Hello (US)

    MessageBundle_en_US.properties file:

    message=Hello (en_US)

    MessageBundle_fr_FR.properties file:

    message=Bonjour

    and the code fragment:

    Locale.setDefault(Locale.FRANCE);

    Locale currentLocale = new Locale.Builder().setLanguage("en").build();

    ResourceBundle messages = ResourceBundle.getBundle("MessageBundle", currentLocale);

    System.out. println(messages.getString("message"));

    Which file will display the content on executing the code fragment?

    A. MessageBundle_en_US.properties
    B. MessageBundle_en.properties
    C. MessageBundle_fr_FR.properties
    D. MessageBundle_US.properties
    E. MessageBundle.properties

  • Question 25:

    Given:

    What code must you insert on Line 1 to enable the code to print Hello world?

    A. Hello.Greeting myG = new Hello.Greeting() myG.sayHi();
    B. Hello myH = new Hello(); Hello.Greeting myG = myH.new Greeting(); myG.sayHi();
    C. Hello myH = new Hello(); Hello.Greeting myG = myH.new Hello.Greeting(); myG.sayHi();
    D. Hello myH = new Hello(); Greeting myG = new Greeting(); myG.sayHi ();

  • Question 26:

    Given:

    var data = new ArrayList<>();

    data.add("Peter");

    data.add(30);

    data.add("Market Road");

    data.set(1, 25);

    data.remove(2);

    data.set(3, 1000L);

    System.out.print(data);

    What is the output?

    A. [Market Road, 1000]
    B. [Peter, 30, Market Road]
    C. [Peter, 25, null, 1000]
    D. An exception is thrown at run time.

  • Question 27:

    Given:

    This code results in a compilation error.

    Which code should be inserted on line 1 for a successful compilation?

    A. Consumer consumer = msg -> { return System.out.print(msg); };
    B. Consumer consumer = var arg -> {System.out.print(arg);};
    C. Consumer consumer = (String args) -> System.out.print(args);
    D. Consumer consumer = System.out::print;

  • Question 28:

    Given:

    You want the code to produce this output:

    John Joe Jane

    Which code fragment should be inserted on line 1 and line 2 to produce the output?

    A. Insert Comparator on line 1. Insert public int compare(Person p1, Person p2) { return p1.name.compare(p2.name); } on line 2.
    B. Insert Comparator on line 1. Insert public int compareTo(Person person) { return person.name.compareTo(this.name); } on line 2.
    C. Insert Comparable on line 1. Insert public int compare(Person p1, Person p2) { return p1.name.compare(p2.name); } on line 2.
    D. Insert Comparator on line 1. Insert public int compare(Person person) { return person.name.compare(this.name); } on line 2.

  • Question 29:

    A bookstore's sales are represented by a list of Sale objects populated with the name of the customer and the books they purchased.

    public class Sale {

    private String customer;

    private List items;

    // constructor, setters and getters not shown

    }

    public class Book {

    private String name;

    private double price;

    // constructor, setters and getters not shown

    }

    Given a list of Sale objects, tList, which code fragment creates a list of total sales for each customer in ascending order?

    A. Option A
    B. Option B
    C. Option C
    D. Option D

  • Question 30:

    Given the code fragment:

    Path source = Paths.get("/repo/a/a.txt"); Path destination = Paths.get("/repo"); Files.move(source, destination); // line 1 Files.delete (source); // line 2

    Assuming the source file and destination folder exist, what Is the result?

    A. A java.nio.file.FileAlreadyExistsException is thrown on line 1.
    B. A java.nio.file.NoSuchFileException is thrown on line 2.
    C. A copy of /repo/a/a.txt is moved to the /repo directory and /repo/a/a.txt is deleted.
    D. a.txt is renamed repo.

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-816 exam preparations and Oracle certification application, do not hesitate to visit our Vcedump.com to find your solutions here.