aiotestking uk

1Z0-809 Exam Questions - Online Test


1Z0-809 Premium VCE File

Learn More 100% Pass Guarantee - Dumps Verified - Instant Download
150 Lectures, 20 Hours

Q1. Which action can be used to load a database driver by using JDBC3.0? 

A. Add the driver class to the META-INF/services folder of the JAR file. 

B. Include the JDBC driver class in a jdbc.properties file. 

C. Use the java.lang.Class.forName method to load the driver class. 

D. Use the DriverManager.getDriver method to load the driver class. 

Answer:

Q2. The protected modifier on a Field declaration within a public class means that the field ______________. 

A. Cannot be modified 

B. Can be read but not written from outside the class 

C. Can be read and written from this class and its subclasses only within the same package 

D. Can be read and written from this class and its subclasses defined in any package 

Answer:

Reference: 

http://beginnersbook.com/2013/05/java-access-modifiers/ 

Q3. Given: 

What is the result? 

A. 6 7 8 

B. 7 8 9 

C. 0 1 2 

D. 6 8 10 

E. Compilation fails 

Answer:

Q4. Which two are Java Exception classes? 

A. SercurityException 

B. DuplicatePathException 

C. IllegalArgumentException 

D. TooManyArgumentsException 

Answer: A,C 

Q5. 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. 2021-02-14 

B. A DateTimeException is thrown. 

C. 2021-02-29 

D. A compilation error occurs at line n1. 

Answer:

Q6. Which statement is true about java.util.stream.Stream? 

A. A stream cannot be consumed more than once. 

B. The execution mode of streams can be changed during processing. 

C. Streams are intended to modify the source data. 

D. A parallel stream is always faster than an equivalent sequential stream. 

Answer:

Q7. Which statement is true about the DriverManager class? 

A. It returns an instance of Connection. 

B. it executes SQL statements against the database. 

C. It only queries metadata of the database. 

D. it is written by different vendors for their specific database. 

Answer:

Explanation: The DriverManager returns an instance of Doctrine\DBAL\Connection which is a wrapper around the underlying driver connection (which is often a PDO instance). Reference: http://doctrine-dbal.readthedocs.org/en/latest/reference/configuration.html 

Q8. Given the records from the Employee table: 

and given the code fragment: 

try { 

Connection conn = DriverManager.getConnection (URL, userName, passWord); 

Statement st = conn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, 

ResultSet.CONCUR_UPDATABLE); 

st.execute(“SELECT*FROM Employee”); 

ResultSet rs = st.getResultSet(); 

while (rs.next()) { 

if (rs.getInt(1) ==112) { 

rs.updateString(2, “Jack”); 

rs.absolute(2); 

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

} catch (SQLException ex) { 

System.out.println(“Exception is raised”); 

Assume that: 

The required database driver is configured in the classpath. 

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

What is the result? 

A. The Employee table is updated with the row: 

112 Jack 

and the program prints: 

112 Jerry 

B. The Employee table is updated with the row: 

112 Jack 

and the program prints: 

112 Jack 

C. The Employee table is not updated and the program prints: 

112 Jerry 

D. The program prints Exception is raised. 

Answer:

Q9. Given the code fragment: 

BiFunction<Integer, Double, Integer> val = (t1, t2) -> t1 + t2;//line n1 

System.out.println(val.apply(10, 10.5)); 

What is the result? 

A. 20 

B. 20.5 

C. A compilation error occurs at line n1. 

D. A compilation error occurs at line n2. 

Answer:

Q10. Given: 

A. Ym Xm2 

B. Ym Xm1 

C. Compilation fails 

D. A ClassCastException is thrown at runtime 

Answer: