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 of Test.java file:

1. package com.sampleproject.oca;

2.  

3. interface Perishable1 {

4.     default int maxDays() {

5.         return 1;

6.     }

7. }

8.  

9. interface Perishable2 extends Perishable1 {

10.     default int maxDays() {

11.         return 2;

12.     }

13. }

14.  

15. class Milk implements Perishable2, Perishable1 {}

16.  

17. public class Test {

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

19.         Perishable1 obj = new Milk();

20.         System.out.println(obj.maxDays());

21.     }

22. }

Which of the following statements is correct?

Options :
Answer: A

Question 2

Given:

HPE6-A70
What is the result?

Options :
Answer: D

Question 3

Consider below codes of 3 java files:

1. //M.java

2. package com.sampleproject.oca;

3.  

4. public class M {

5.     public void printName() {

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

7.     }

8. }

1. //N.java

2. package com.sampleproject.oca;

3.  

4. public class N extends M {

5.     public void printName() {

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

7.     }

8. }

1. //Test.java

2. package com.sampleproject.oca.test;

3.  

4. import com.sampleproject.oca.*;

5.  

6. public class Test {

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

8.         M obj1 = new M();

9.         N obj2 = (N)obj1;

10.         obj2.printName();

11.     }

12. }

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

Options :
Answer: C

Question 4

Given the code fragment:

1Z0-808
What is the result?

Options :
Answer: A

Question 5

Consider below code of Test.java file:

1. package com.sampleproject.oca;

2.  

3. class Super {

4.     public String num = "10"; //Line n1

5. }

6.  

7. class Sub extends Super {

8.     protected int num = 20; //Line n2

9. }

10.  

11. public class Test {

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

13.         Super obj = new Sub();

14.         System.out.println(obj.num += 2); //Line n3

15.     }

16. }

What will be the result of compiling and executing above code?

Options :
Answer: F

© 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.