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

    Which statement about a functional interface is true?

    A. It must be defined with the public access modifier.
    B. It must be annotated with @FunctionalInterface.
    C. It is declared with a single abstract method.
    D. It is declared with a single default method.
    E. It cannot have any private methods and static methods.

  • Question 52:

    Given:

    LocalDate d1 = LocalDate.of(1997,2,7); DateTimeFormatter dtf = DateTimeFormatter.ofPattern( /*insert code here*/ ); System.out.println(dtf.format (d1));

    Which pattern formats the date as Friday 7th of February 1997?

    A. "eeee dd+"th of"+ MMM yyyy"
    B. "eeee dd'th of' MMM yyyy"
    C. "eeee d+"th of"+ MMMM yyyy"
    D. "eeee d'th of' MMMM yyyy"

  • Question 53:

    Given the code fragment:

    Path currentFile = Paths.get("/scratch/exam/temp.txt"); Path outputFile = Paths get("/scratch/exam/new.txt"); Path directory = Paths.get("/scratch/");

    Files.copy(currentFile, outputFile); Files.copy(outputFile, directory); Files.delete (outputFile);

    The /scratch/exam/temp.txt file exists. The /scratch/exam/new.txt and /scratch/new.txt files do not exist.

    What is the result?

    A. /scratch/exam/new.txt and /scratch/new.txt are deleted.
    B. The program throws a FileaAlreadyExistsException.
    C. The program throws a NoSuchFileException.
    D. A copy of /scratch/exam/new.txt exists in the /scratch directory and /scratch/exam/new.txt is deleted.

  • Question 54:

    Given:

    What is the output?

    A. null
    B. A NoSuchElementException is thrown at run time.
    C. Duke
    D. A NullPointerException is thrown at run time.

  • Question 55:

    Assume ds is a DataSource and the EMP table is defined appropriately.

    What does executing this code fragment do?

    A. inserts two rows (101, 'SMITH', 'HR') and (102, 'JONES', NULL)
    B. inserts two rows (101, 'SMITH', 'HR') and (102, 'JONES', 'HR')
    C. inserts one row (101, 'SMITH', 'HR')
    D. throws a SQLException

  • Question 56:

    Given:

    var fruits = List.of("apple", "orange", "banana", "lemon");

    You want to examine the first element that contains the character n.

    Which statement will accomplish this?

    A. String result = fruits.stream().filter(f -> f.contains("n")).findAny();
    B. fruits.stream().filter(f -> f.contains("n")).forEachOrdered(System.out::print);
    C. Optional result = fruits.stream().filter(f -> f.contains("n")).findFirst ();
    D. Optional result = fruits.stream().anyMatch(f -> f.contains("n"));

  • Question 57:

    Given:

    What is required to make the Foo class thread safe?

    A. No change is required.
    B. Make the declaration of lock static.
    C. Replace the lock constructor call with new ReentrantLock (true).
    D. Move the declaration of lock inside the foo method.

  • Question 58:

    Given:

    and:

    Which code, when inserted on line 10, prints the number of unique localities from the roster list?

    A. .map(Employee::getLocality) .distinct() .count();
    B. map(e -> e.getLocality()) .count();
    C. .map(e -> e.getLocality()) .collect(Collectors.toSet()) .count();
    D. .filter(Employee::getLocality) .distinct() .count();

  • Question 59:

    Given the declaration:

    Examine this code fragment:

    /* Loc1 */ class ProcessOrders { ... }

    Which two annotations may be applied at Loc1 in the code fragment? (Choose two.)

    A. @Resource(priority=100)
    B. @Resource(priority=0)
    C. @Resource(name="Customer1", priority=100)
    D. @Resource(name="Customer1")
    E. @Resource

  • Question 60:

    Given:

    String originalPath = "data\\projects\\a-project\\..\\..\\another-project"; Path path = Paths.get(originalPath); System.out.print(path.normalize());

    What is the result?

    A. data\another-project
    B. data\projects\a-project\another-project
    C. data\\projects\\a-project\\..\\..\\another-project
    D. data\projects\a-project\..\..\another-project

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.