1Z0-809 Exam Details

  • Exam Code
    :1Z0-809
  • Exam Name
    :Java SE 8 Programmer II
  • Certification
    :Oracle Certifications
  • Vendor
    :Oracle
  • Total Questions
    :207 Q&As
  • Last Updated
    :May 29, 2026

Oracle 1Z0-809 Online Questions & Answers

  • Question 91:

    Given the code fragments:

    class Caller implements Callable {

    String str;

    public Caller (String s) {this.str=s;}

    public String call()throws Exception { return str.concat ("Caller");}

    }

    class Runner implements Runnable {

    String str;

    public Runner (String s) {this.str=s;}

    public void run () { System.out.println (str.concat ("Runner"));}

    }

    and

    public static void main (String[] args) throws InterruptedException, ExecutionException { ExecutorService es = Executors.newFixedThreadPool(2);

    Future f1 = es.submit (new Caller ("Call"));

    Future f2 = es.submit (new Runner ("Run"));

    String str1 = (String) f1.get();

    String str2 = (String) f2.get(); //line n1

    System.out.println(str1+ ":" + str2);

    }

    What is the result?

    A. The program prints: Run Runner Call Caller : null And the program does not terminate.
    B. The program terminates after printing: Run Runner Call Caller : Run
    C. A compilation error occurs at line n1.
    D. An Execution is thrown at run time.

  • Question 92:

    Given that course.txt is accessible and contains:

    Course : : Java

    and given the code fragment:

    public static void main (String[ ] args) { int i; char c; try (FileInputStream fis = new FileInputStream (“course.txt”);

    InputStreamReader isr = new InputStreamReader(fis);) {

    while (isr.ready()) { //line n1

    isr.skip(2);

    i = isr.read ();

    c = (char) i;

    System.out.print(c);

    }

    } catch (Exception e) {

    e.printStackTrace();

    } }

    What is the result?

    A. ur :: va
    B. ueJa
    C. The program prints nothing.
    D. A compilation error occurs at line n1.

  • Question 93:

    Given:

    class FuelNotAvailException extends Exception { } class Vehicle { void ride() throws FuelNotAvailException { //line n1 System.out.println("Happy Journey!"); } } class SolarVehicle extends Vehicle { public void ride () throws FuelNotAvailException { //line n2 super ride (); } }

    and the code fragment:

    public static void main (String[] args) throws Exception { Vehicle v = new SolarVehicle ();

    A. ride(); } Which modification enables the code fragment to print Happy Journey!?
    B. Replace line n1 with public void ride() throws FuelNotAvailException {
    C. Replace line n1 with protected void ride() throws Exception {
    D. Replace line n2 with void ride() throws Exception {
    E. Replace line n2 with private void ride() throws FuelNotAvailException {

  • Question 94:

    Given the code fragments:

    and

    What is the result?

    A. Video played.Game played.
    B. A compilation error occurs.
    C. class java.lang.Exception
    D. class java.io.IOException

  • Question 95:

    Given the code fragment:

    Map books = new TreeMap<>();

    books.put (1007, "A");

    books.put (1002, "C");

    books.put (1003, "B");

    books.put (1003, "B");

    System.out.println (books);

    What is the result?

    A. {1007=A, 1003=B, 1002=C}
    B. {1007=A, 1003=B, 1003=B, 1002=C}
    C. {1007=A, 1002=C, 1003=B, 1003=B}
    D. {1002=C, 1003=B, 1007=A}

  • Question 96:

    Given the code fragment:

    Stream files = Files.walk(Paths.get(System.getProperty("user.home")));

    files.forEach (fName -> { //line n1

    try {

    Path aPath = fName.toAbsolutePath(); //line n2

    System.out.println(fName + ":"

    + Files.readAttributes(aPath, Basic.File.Attributes.class).creationTime

    ());

    } catch (IOException ex) {

    ex.printStackTrace();

    });

    What is the result?

    A. All files and directories under the home directory are listed along with their attributes.
    B. A compilation error occurs at line n1.
    C. The files in the home directory are listed along with their attributes.
    D. A compilation error occurs at line n2.

  • Question 97:

    Given that these files exist and are accessible:

    and given the code fragment:

    Which code fragment can be inserted at line n1 to enable the code to print only /company/emp?

    A. Stream stream = Files.list (Paths.get ("/company"));
    B. Stream stream = Files.find( Paths.get (“/company”), 1, (p,b) –andgt; b.isDirectory (), FileVisitOption.FOLLOW_LINKS);
    C. Stream stream = Files.walk (Paths.get ("/company"));
    D. Stream stream = Files.list (Paths.get ("/company/emp"));

  • Question 98:

    Given the code fragment:

    Assume that:

    The required database driver is configured in the classpath.

    The appropriate database is accessible with the dbURL, userName, and passWord exists

    The Employee table has a column ID of type integer and the SQL query matches one record.

    What is the result?

    A. Compilation fails at line 14.
    B. Compilation fails at line 15.
    C. The code prints the employee ID.
    D. The code prints Error.

  • Question 99:

    Given the code fragment:

    Path source = Paths.get ("/data/december/log.txt");

    Path destination = Paths.get("/data");

    Files.copy (source, destination);

    and assuming that the file /data/december/log.txt is accessible and contains:

    10-Dec-2014 - Executed successfully

    What is the result?

    A. A file with the name log.txt is created in the /data directory and the content of the /data/december/log.txt file is copied to it.
    B. The program executes successfully and does NOT change the file system.
    C. A FileNotFoundException is thrown at run time.
    D. A FileAlreadyExistsException is thrown at run time.

  • Question 100:

    Given:

    class RateOfInterest {

    public static void main (String[] args) {

    int rateOfInterest = 0;

    String accountType = "LOAN";

    switch (accountType) {

    case "RD";

    rateOfInterest = 5;

    break;

    case "FD";

    rateOfInterest = 10;

    break;

    default:

    assert false: "No interest for this account"; //line n1

    }

    System.out.println ("Rate of interest:" + rateOfInterest);

    }

    }

    and the command:

    java -ea RateOfInterest

    What is the result?

    A. Rate of interest: 0
    B. An AssertionError is thrown.
    C. No interest for this account
    D. A compilation error occurs at line n1.

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