1Z0-809 Practice Online

Quickly grab our 1Z0-809 product now and kickstart your exam preparation today!

Name: Java SE 8 Programmer II
Exam Code: 1Z0-809
Certification: Oracle Java
Vendor: Oracle
Total Questions: 469
Last Updated: Apr 24, 2024
Page:    1 / 94      
Total 469 Questions | Updated On: Apr 24, 2024
Question 1

Given the code fragment:

Untitled1-page69-image23
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?


Answer: A

Question 2

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 –da option?


Answer: A

Question 3

What will be the result of compiling and executing class M?

1. package com.udayan.ocp;

2.  

3. class M {

4.     private int num1 = 100;

5.     class N {

6.         private int num2 = 200;

7.     }

8.     

9.     public static void main(String[] args) {

10.         M outer = new M();

11.         M.N inner = outer.new N();

12.         System.out.println(outer.num1 + inner.num2);

13.     }

14. }


Answer: A

Question 4

Given code of Test.java file: 

1. package com.udayan.ocp;

2.  

3. import java.util.Arrays;

4. import java.util.List;

5. import java.util.ListIterator;

6.  

7. public class Test {

8.     public static void main(String[] args) {

9.         List list = Arrays.asList("T", "S", "R", "I", "F");

10.         ListIterator iter = list.listIterator(2);

11.         while(iter.hasNext()) {

12.             System.out.print(iter.next());

13.         }

14.     }

15. }

What will be the result of compiling and executing Test class?


Answer: B

Question 5

Given the code fragment:
List<String> colors = Arrays.asList(“red”, “green”, “yellow”);
Predicate<String> test = n - > {
 System.out.println(“Searching…”);
 return n.contains(“red”);
};
colors.stream()
 .filter(c -> c.length() >= 3)
 .allMatch(test);
What is the result?


Answer: C

Page:    1 / 94      
Total 469 Questions | Updated On: Apr 24, 2024