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

    Given the code fragment:

    class CallerThread implements Callable {

    String str;

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

    public String call() throws Exception {

    return str.concat("Call");

    }

    }

    and

    public static void main (String[] args) throws InterruptedException, ExecutionException

    {

    ExecutorService es = Executors.newFixedThreadPool(4); //line n1

    Future f1 = es.submit (newCallerThread("Call"));

    String str = f1.get().toString();

    System.out.println(str);

    }

    Which statement is true?

    A. The program prints Call Call and terminates.
    B. The program prints Call Call and does not terminate.
    C. A compilation error occurs at line n1.
    D. An ExecutionException is thrown at run time.

  • Question 142:

    Given the code fragment:

    LocalDate valentinesDay =LocalDate.of(2015, Month.FEBRUARY, 14);

    LocalDate nextYear = valentinesDay.plusYears(1);

    nextYear.plusDays(15); //line n1

    System.out.println(nextYear);

    What is the result?

    A. 2016-02-14
    B. A DateTimeException is thrown.
    C. 2016-02-29
    D. A compilation error occurs at line n1.

  • Question 143:

    Given the code fragment:

    public void recDelete (String dirName) throws IOException {

    File [ ] listOfFiles = new File (dirName) .listFiles();

    if (listOfFiles ! = null andand listOfFiles.length >0) {

    for (File aFile : listOfFiles) {

    if (!aFile.isDirectory ()) {

    if (aFile.getName ().endsWith (".class"))

    aFile.delete ();

    }

    }

    }

    }

    Assume that Projects contains subdirectories that contain .class files and is passed as an argument to the recDelete () method when it is invoked.

    What is the result?

    A. The method deletes all the .class files in the Projects directory and its subdirectories.
    B. The method deletes the .class files of the Projects directory only.
    C. The method executes and does not make any changes to the Projects directory.
    D. The method throws an IOException.

  • Question 144:

    Given the code fragment:

    List codes = Arrays.asList ("DOC", "MPEG", "JPEG");

    codes.forEach (c -> System.out.print(c + " "));

    String fmt = codes.stream()

    .filter (s-> s.contains ("PEG"))

    .reduce((s, t) -> s + t).get();

    System.out.println("\n" + fmt);

    What is the result?

    A. DOC MPEG JPEG MPEGJPEG
    B. DOC MPEG MPEGJPEG MPEGMPEGJPEG
    C. MPEGJPEG MPEGJPEG
    D. The order of the output is unpredictable.

  • Question 145:

    Given:

    Item table

    ID, INTEGER: PK

    DESCRIP, VARCHAR(100)

    PRICE, REAL

    QUANTITY< INTEGER

    And given the code fragment:

    9.

    try {

    10.

    Connection conn = DriveManager.getConnection(dbURL, username, password);

    11.

    String query = “Select * FROM Item WHERE ID = 110”;

    12.

    Statement stmt = conn.createStatement();

    13.

    ResultSet rs = stmt.executeQuery(query);

    14.

    while(rs.next()) {

    15.

    System.out.println(“ID: “ + rs.getInt(“Id”));

    16.

    System.out.println(“Description: “ + rs.getString(“Descrip”));

    17.

    System.out.println(“Price: “ + rs.getDouble(“Price”));

    18.

    System.out.println(Quantity: “ + rs.getInt(“Quantity”));

    19.

    }

    20.

    } catch (SQLException se) {

    21.

    System.out.println(“Error”);

    22.

    }

    Assume that: The required database driver is configured in the classpath. The appropriate database is accessible with the dbURL, userName, and passWord exists. The SQL query is valid.

    What is the result?

    A. An exception is thrown at runtime.
    B. Compilation fails.
    C. The code prints Error.
    D. The code prints information about Item 110.

  • Question 146:

    Given the content of /resourses/Message.properties:

    welcome1="Good day!"

    and given the code fragment:

    Properties prop = new Properties ();

    FileInputStream fis = new FileInputStream ("/resources/Message.properties");

    prop.load(fis);

    System.out.println(prop.getProperty("welcome1"));

    System.out.println(prop.getProperty("welcome2", "Test"));//line n1

    System.out.println(prop.getProperty("welcome3"));

    What is the result?

    A. Good day! Test followed by an Exception stack trace
    B. Good day! followed by an Exception stack trace
    C. Good day! Test null
    D. A compilation error occurs at line n1.

  • Question 147:

    Given:

    Item table

    ?ID, INTEGER: PK ?DESCRIP, VARCHAR(100) ?PRICE, REAL ?QUANTIT<; INTEGER

    And given the code fragment:

    9.

    try {

    10.

    Connection conn = DriveManager.getConnection(dbURL, username, password);

    11.

    String query = "Select * FROM Item WHERE ID = 110";

    12.

    Statement stmt = conn.createStatement();

    13.

    ResultSet rs = stmt.executeQuery(query);

    14.

    while(rs.next()) {

    15.

    System.out.println("ID: " + rs.getString(1));

    16.

    System.out.println("Description: " + rs.getString(2));

    17.

    System.out.println("Price: " + rs.getString(3));

    18.

    System.out.println(Quantity: " + rs.getString(4));

    19.

    }

    20.

    } catch (SQLException se) {

    21.

    System.out.println("Error");

    22.

    }

    Assume that:

    The required database driver is configured in the classpath.

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

    The SQL query is valid.

    What is the result?

    A. An exception is thrown at runtime.
    B. Compilation fails.
    C. The code prints Error.
    D. The code prints information about Item 110.

  • Question 148:

    Given the code fragment:

    UnaryOperator uo1 = s -> s*2; line n1

    List loanValues = Arrays.asList(1000.0, 2000.0);

    loanValues.stream()

    .filter(lv -> lv >= 1500)

    .map(lv -> uo1.apply(lv))

    .forEach(s -> System.out.print(s + " "));

    What is the result?

    A. 4000.0
    B. 4000
    C. A compilation error occurs at line n1.
    D. A compilation error occurs at line n2.

  • Question 149:

    Given records from the Player table:

    and given the code fragment:

    try {

    Connection conn = DriverManager.getConnection(URL, username, password);

    Statement st= conn.createStatement(

    ResultSet.TYPE_SCROLL_SENSITIVE,

    ResultSet.CONCUR_UPDATABLE);

    st.execute ("SELECT * FROM Player");

    st.setMaxRows(2);

    ResultSet rs = st.getResultSet();

    rs.absolute(3);

    while (rs.next ()) {

    System.out.println(rs.getInt(1) + " " + rs.getString(2));

    }

    } catch (SQLException ex) {

    System.out.print("SQLException is thrown.");

    }

    Assume that:

    The required database driver is configured in the classpath.

    The appropriate database is accessible with URL, username, and password.

    The SQL query is valid.

    What is the result?

    A. 2 Jack 3 Sam
    B. The program prints nothing.
    C. 3 Sam
    D. SQLException is thrown.

  • Question 150:

    Given the code fragment:

    What is the result?

    A. A compilation error occurs.
    B. [Java, J2EE, J2ME, JSTL, JSP]
    C. null
    D. [Java, J2EE, J2ME, JSTL]

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.