Exam Details

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

Oracle Oracle Database 1Z0-809 Questions & Answers

  • Question 41:

    Which statement is true about the single abstract method of the java.util.function.Predicate interface?

    A. It accepts one argument and returns void.

    B. It accepts one argument and returns boolean.

    C. It accepts one argument and always produces a result of the same type as the argument.

    D. It accepts an argument and produces a result of any data type.

  • Question 42:

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

    Given:

    public class Counter {

    public static void main (String[ ] args) {

    int a = 10;

    int b = -1;

    assert (b >=1) : "Invalid Denominator";

    int = a / b;

    System.out.println (c);

    }

    }

    What is the result of running the code with the 璬a option?

    A. -10

    B. 0

    C. An AssertionError is thrown.

    D. A compilation error occurs.

  • Question 44:

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

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

    Given the code fragments:

    interface CourseFilter extends Predicate { public default boolean test (String str) {

    return str.contains ("Java");

    }

    }

    and

    List strs = Arrays.asList("Java", "Java EE", "Embedded Java");

    Predicate cf1 = s - > s.length() > 3;

    Predicate cf2 = new CourseFilter() { //line n1

    public boolean test (String s) {

    return s.startsWith ("Java");

    }

    };

    long c = strs.stream()

    .filter(cf1)

    .filter(cf2 //line n2

    .count();

    System.out.println(c);

    What is the result?

    A. 2

    B. 3

    C. A compilation error occurs at line n1.

    D. A compilation error occurs at line n2.

  • Question 47:

    Given:

    Which option fails?

    A. Foo mark = new Foo ("Steve", 100);

    B. Foo pair = Foo.twice ("Hello World!");

    C. Foo percentage = new Foo("Steve", 100);

    D. Foo grade = new Foo <> ("John", "A");

  • Question 48:

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

    Given the code fragment:

    Which should be inserted into line n1 to print Average = 2.5?

    A. IntStream str = Stream.of (1, 2, 3, 4);

    B. IntStream str = IntStream.of (1, 2, 3, 4);

    C. DoubleStream str = Stream.of (1.0, 2.0, 3.0, 4.0);

    D. Stream str = Stream.of (1, 2, 3, 4);

  • Question 50:

    Given the structure of the Student table: Student (id INTEGER, name VARCHAR) Given the records from the STUDENT table:

    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.

    What is the result?

    A. The program prints Status: true and two records are deleted from the Student table.

    B. The program prints Status: false and two records are deleted from the Student table.

    C. A SQLException is thrown at runtime.

    D. The program prints Status: false but the records from the Student table are not deleted.

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.