Want to know Examcollection 1Z0-809 Exam practice test features? Want to lear more about Oracle Java SE 8 Programmer II certification experience? Study Free Oracle 1Z0-809 answers to Regenerate 1Z0-809 questions at Examcollection. Gat a success with an absolute guarantee to pass Oracle 1Z0-809 (Java SE 8 Programmer II) test on your first attempt.

2021 Nov 1Z0-809 free exam questions

Q81. Given: 

IntStream stream = IntStream.of (1,2,3); IntFunction<Integer> inFu= x -> y -> x*y;//line n1 IntStream newStream = stream.map(inFu.apply(10));//line n2 

newStream.forEach(System.output::print); 

Which modification enables the code fragment to compile? 

A. Replace line n1 with: 

IntFunction<UnaryOperator> inFu = x -> y -> x*y; 

B. Replace line n1 with: 

IntFunction<IntUnaryOperator> inFu = x -> y -> x*y; 

C. Replace line n1 with: 

BiFunction<IntUnaryOperator> inFu = x -> y -> x*y; 

D. Replace line n2 with: 

IntStream newStream = stream.map(inFu.applyAsInt (10)); 

Answer:


Q82. 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:


Q83. Given: What is the result? 

A. 100 210 

B. Compilation fails due to an error in line n1 

C. Compilation fails due to an error at line n2 

D. Compilation fails due to an error at line n3 

Answer:


Q84. public class ForTest { 

public static void main(String[] args) { 

int[] arrar = {1,2,3}; 

for ( foo ) { 

Which three are valid replacements for foo so that the program will compiled and run? 

A. int i: array 

B. int i = 0; i < 1; i++ 

C. ;; 

D. ; i < 1; i++ 

E. ; i < 1; 

Answer: A,B,C 


Avant-garde 1Z0-809 latest exam:

Q85. Which two statements are true about localizing an application? 

A. Support for new regional languages does not require recompilation of the code. 

B. Textual elements (messages and GUI labels) are hard-coded in the code. 

C. Language and region-specific programs are created using localized data. 

D. Resource bundle files include data and currency information. 

E. Language codes use lowercase letters and region codes use uppercase letters. 

Answer: A,E 

Reference: http://docs.oracle.com/javase/7/docs/technotes/guides/intl/ 


Q86. Given the code fragment: 

9. 

Connection conn = DriveManager.getConnection(dbURL, userName, passWord); 

10. 

String query = “SELECT id FROM Employee”; 

11. 

try (Statement stmt = conn.createStatement()) { 

12. 

ResultSet rs = stmt.executeQuery(query); 13.stmt.executeQuery(“SELECT id FROM Customer”); 

14. 

while (rs.next()) { 

15. 

//process the results 16.System.out.println(“Employee ID: “+ rs.getInt(“id”)); 17.} 

18. 

} catch (Exception e) { 

19. 

System.out.println (“Error”); 

20. 

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 and Customer tables are available and each table has id column with a few 

records and the SQL queries are valid. 

What is the result of compiling and executing this code fragment? 

A. The program prints employee IDs. 

B. The program prints customer IDs. 

C. The program prints Error. 

D. compilation fails on line 13. 

Answer:


Q87. Given the fragments: 

Which line causes a compilation error? 

A. Line n1 

B. Line n2 

C. Line n3 

D. Line n4 

Answer:


Q88. Given the code fragment: 

int b = 3; 

if ( !(b > 3)) { 

System.out.println("square "); 

}{ 

System.out.println("circle "); 

System.out.println("..."); 

What is the result? 

A. square... 

B. circle... 

C. squarecircle... 

D. Compilation fails. 

Answer:


Q89. Given the code fragment: 

Path path1 = Paths.get(“/app/./sys/”); 

Path res1 = path1.resolve(“log”); 

Path path2 = Paths.get(“/server/exe/”); 

Path res1 = path1.resolve(“/readme/”); 

System.out.println(res1); 

System.out.println(res2); 

What is the result? 

A. /app/sys/log /readme/server/exe 

B. /app/log/sys /server/exe/readme 

C. /app/./sys/log /readme 

D. /app/./sys/log /server/exe/readme 

Answer: