EXPERTY DESIGNED 1Z0-808 PRACTICE TEST

Oracle 1Z0-808 Exam Questions
Total Questions: 608
Java SE 8 Programmer I
Updated On: Nov 26, 2025
Page : 1-61
Question 1

Consider below code:

1. //Test.java

2. package com.udayan.oca;

3.  

4. import java.util.ArrayList;

5. import java.util.Iterator;

6. import java.util.List;

7. import java.util.function.Predicate;

8.  

9. class Employee {

10.      private String name;

11.      private int age;

12.      private double salary;

13.  

14.      public Employee(String name, int age, double salary) {

15.          this.name = name;

16.          this.age = age;

17.          this.salary = salary;

18.      }

19.  

20.      public String getName() {

21.          return name;

22.      }

23.  

24.     public int getAge() {

25.          return age;

26.      }

27.  

28.     public double getSalary() {

29.          return salary;

30.      }

31.  

32.     public String toString() {

33.          return name;

34.      }

35. }

36.  

37. public class Test {

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

39.          List list = new ArrayList<>();

40.          list.add(new Employee("James", 25, 15000));

41.          list.add(new Employee("Lucy", 23, 12000));

42.          list.add(new Employee("Bill", 27, 10000));

43.          list.add(new Employee("Jack", 19, 5000));

44.          list.add(new Employee("Liya", 20, 8000));

45.  

46.          process(list, /*INSERT*/);

47.  

48.          System.out.println(list);

49.      }

50.  

51.      private static void process(List list, Predicate predicate) {

52.          Iterator iterator = list.iterator();

53.          while(iterator.hasNext()) {

54.              if(predicate.test(iterator.next()))

55.              iterator.remove();

56.          }

57.       }

58. }

Which of the following lambda expressions, if used to replace /*INSERT*/, prints [Jack, Liya] on to the console?

Select 2 options.

Options :
Answer: B,C

Question 2

Given the code fragment:

HPE6-A70
Which code fragment, when inserted at line 9, enables the code to print true?

Options :
Answer: A

Question 3

Consider below code of Test.java file:

1. package com.sampleproject.oca;

2.  

3. public class Test {

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

5.         int i = 1;

6.         int j = 5;

7.         int k = 0;

8.         A: while(true) {

9.             i++;

10.             B: while(true) {

11.                 j--;

12.                 C: while(true) {

13.                     k += i + j;

14.                     if(i == j)

15.                         break A;

16.                     else if (i > j)

17.                         continue A;

18.                     else 

19.                         continue B;

20.                 }

21.             }

22.         }

23.         System.out.println(k);

24.     }

25. }

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

Options :
Answer: C

Question 4

Given:

1Z0-808
What is the result?

Options :
Answer: D

Question 5

What is the signature of special main method?

Options :
Answer: D

© Copyrights Oracledumps 2025. All Rights Reserved

We use cookies to ensure that we give you the best experience on our website (Oracledumps). If you continue without changing your settings, we'll assume that you are happy to receive all cookies on the Oracledumps.