Testking offers free demo for 1Z0-809 exam. "Java SE 8 Programmer II", also known as 1Z0-809 exam, is a Oracle Certification. This set of posts, Passing the Oracle 1Z0-809 exam, will help you answer those questions. The 1Z0-809 Questions & Answers covers all the knowledge points of the real exam. 100% real Oracle 1Z0-809 exams and revised by experts!
♥♥ 2021 NEW RECOMMEND ♥♥
Free VCE & PDF File for Oracle 1Z0-809 Real Exam (Full Version!)
★ Pass on Your First TRY ★ 100% Money Back Guarantee ★ Realistic Practice Exam Questions
Free Instant Download NEW 1Z0-809 Exam Dumps (PDF & VCE):
Available on:
http://www.surepassexam.com/1Z0-809-exam-dumps.html
Q51. 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.
Answer: C
Q52. Which two reasons should you use interfaces instead of abstract classes?
A. You expect that classes that implement your interfaces have many common methods or fields, or require access modifiers other than public.
B. You expect that unrelated classes would implement your interfaces.
C. You want to share code among several closely related classes.
D. You want to declare non-static on non-final fields.
E. You want to take advantage of multiple inheritance of type.
Answer: A,E
Reference: http://www.programmerinterview.com/index.php/java-questions/interface-vs-abstract-class/
Q53. Given: What is the result?
A. box
B. nbo
C. bo
D. nb
E. An exception is thrown at runtime
Answer: E
Q54. Given:
What is the result?
A. Good Day! Good Luck!
B. Good Day! Good Day!
C. Good Luck! Good Day!
D. Good Luck! Good Luck!
E. Compilation fails
Answer: E
Q55. Given the code fragment:
String str = “Java is a programming language”; ToIntFunction<String> indexVal = str: : indexOf; //line n1 int x = indexVal.applyAsInt(“Java”);//line n2 System.out.println(x);
What is the result?
A. 0
B. 1
C. A compilation error occurs at line n1.
D. A compilation error occurs at line n2.
Answer: A
Q56. Which two are Java Exception classes?
A. SercurityException
B. DuplicatePathException
C. IllegalArgumentException
D. TooManyArgumentsException
Answer: A,C
Q57. Given the code fragments:
class TechName {
String techName;
TechName (String techName) {
this.techName=techName;
}
}
and
List<TechName> tech = Arrays.asList (
new TechName(“Java-“),
new TechName(“Oracle DB-“),
new TechName(“J2EE-“)
);
Stream<TechName> stre = tech.stream();
//line n1
Which should be inserted at line n1 to print Java-Oracle DB-J2EE-?
A. stre.forEach(System.out::print);
B. stre.map(a-> a.techName).forEach(System.out::print);
C. stre.map(a-> a).forEachOrdered(System.out::print);
D. stre.forEachOrdered(System.out::print);
Answer: C
Q58. Given:
interface Rideable {Car getCar (String name); }
class Car {
private String name;
public Car (String name) {
this.name = name;
}
}
Which code fragment creates an instance of Car?
A. Car auto = Car (“MyCar”): : new;
B. Car auto = Car : : new;
Car vehicle = auto : : getCar(“MyCar”);
C. Rideable rider = Car : : new;
Car vehicle = rider.getCar(“MyCar”);
D. Car vehicle = Rideable : : new : : getCar(“MyCar”);
Answer: C
Q59. Given the code fragment:
Which code fragment prints blue, cyan, ? A. Option A
B. Option B
C. Option C
D. Option D
Answer: A
Q60. 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?
A. The program executes successfully and the STUDENT table is updated with one record.
B. The program executes successfully and the STUDENT table is NOT updated with any record.
C. A SQLException is thrown as runtime.
D. A NullPointerException is thrown as runtime.
Answer: D
