1z0-809 Exam Question 46

Given the code fragments:

and

What is the result?
  • 1z0-809 Exam Question 47

    Given the structure of the STUDENT table:
    Student (id INTEGER, name VARCHAR)
    Given:
    public class Test {
    static Connection newConnection =null;
    public static Connection get DBConnection () throws SQLException {
    try (Connection con = DriveManager.getConnection(URL, username,
    password)) {
    newConnection = con;
    }
    return newConnection;
    }
    public static void main (String [] args) throws SQLException {
    get DBConnection ();
    Statement st = newConnection.createStatement();
    st.executeUpdate("INSERT INTO student VALUES (102, `Kelvin')");
    }
    }
    Assume that:
    - The required database driver is configured in the classpath.
    - The appropriate database is accessible with the URL, userName, and
    passWord exists.
    - The SQL query is valid.
    What is the result?
  • 1z0-809 Exam Question 48

    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 ();
    v.ride();
    }
    Which modification enables the code fragment to print Happy Journey!?
  • 1z0-809 Exam Question 49

    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?
  • 1z0-809 Exam Question 50

    Given that /green.txtand /colors/yellow.txtare accessible, and the code fragment:
    Path source = Paths.get("/green.txt);
    Path target = Paths.get("/colors/yellow.txt);
    Files.move(source, target, StandardCopyOption.ATOMIC_MOVE);
    Files.delete(source);
    Which statement is true?