top of page

1Z0-808 Oracle Certified Associate Java SE8 Sample Questions

  • CertiMaan
  • Oct 27
  • 9 min read

Prepare effectively for the Oracle Certified Associate Java SE8 1Z0-808 exam with our curated sample questions, practice tests, and mock exams. These resources are designed to mirror the official exam format and cover key topics like Java basics, object-oriented programming, flow control, arrays, and API classes. Ideal for aspiring Java developers, this comprehensive material ensures you're equipped to handle real exam scenarios. Whether you're using the 1Z0-808 dumps or seeking fresh practice exams, this set of resources offers the confidence and knowledge needed to pass the Java SE8 Associate certification with ease.



1Z0-808 Oracle Certified Associate Java SE8 Sample Questions List :


1. Consider below code of Test.java file: package com.udayan.oca; import java.util.ArrayList; import java.util.List; interface Sellable {} abstract class Animal {} class Mammal extends Animal{} class Rabbit extends Mammal implements Sellable{} public class Test { { List<Animal> list = new ArrayList<>(); list.add(new Rabbit()); } { List<Animal> list = new ArrayList<>(); list.add(new Mammal()); } { List<Mammal> list = new ArrayList<>(); list.add(new Rabbit()); } { List<Sellable> list = new ArrayList<>(); list.add(new Mammal()); } { List<Sellable> list = new ArrayList<>(); list.add(new Rabbit()); } } Which of the following statement is true?

  1. Four initializer blocks cause compilation error.

  2. Five initializer blocks cause compilation error.

  3. Two initializer blocks cause compilation error.

  4. Only one initializer block causes compilation error.

  5. Three initializer blocks cause compilation error.

2. Given code of Test.java file: public class Test { public static void main(String[] args) { try { try { System.out.println(args[1]); //Line n1 } catch(RuntimeException e) { System.out.print("INHALE-"); //Line n2 throw e; //Line n3 } finally { System.out.print("EXHALE-"); //Line n4 } } catch(RuntimeException e) { System.out.print("INHALE-"); //Line n5 } finally { System.out.print("EXHALE"); //Line n6 } } } And the commands: javac Test.java java Test What is the result?

  1. INHALE-EXHALE-INHALE-

  2. INHALE-EXHALE-EXHALE

  3. INHALE-EXHALE

  4. INHALE-EXHALE-

  5. INHALE-EXHALE-INHALE-EXHALE

3. Consider below code fragment: private void emp() {} And the statements: 1. Given code compiles successfully if it is used inside the class named 'emp' 2. Given code compiles successfully if it is used inside the class named 'Emp' 3. Given code compiles successfully if it is used inside the class named 'employee' 4. Given code compiles successfully if it is used inside the class named 'Employee' 5. Given code compiles successfully if it is used inside the class named 'Student' 6. Given code compiles successfully if it is used inside the class named '_emp_' How many statements are true?

  1. Three statements

  2. Only one statement

  3. Four statements

  4. Five statements

  5. All six statements

  6. Two statements

4. What will be the result of compiling and executing Test class package com.udayan.oca; import java.util.ArrayList; import java.util.List; public class Test { public static void main(String[] args) { List<String> fruits = new ArrayList<>(); fruits.add("apple"); fruits.add("orange"); fruits.add("grape"); fruits.add("mango"); fruits.add("banana"); fruits.add("grape"); if(fruits.remove("grape")) fruits.remove("apple"); System.out.println(fruits); } } ?

  1. [orange, mango, banana, grape]

  2. [orange, grape, mango, banana]

  3. An exception is thrown at runtime

  4. Compilation error

5. What will be the result of compiling and executing Circus //Circus.java package com.udayan.oca; class Animal { protected void jump() { System.out.println("Animal"); } } class Cat extends Animal { public void jump(int a) { System.out.println("Cat"); } } class Deer extends Animal { public void jump() { System.out.println("Deer"); } } public class Circus { public static void main(String[] args) { Animal cat = new Cat(); Animal deer = new Deer(); cat.jump(); deer.jump(); } } ?

  1. Animal Deer

  2. Cat Animal

  3. Animal Animal

  4. Cat Deer

6. package com.udayan.oca; class TestException extends Exception { public TestException() { super(); } public TestException(String s) { super(s); } } public class Test { public void m1() throws __________ { throw new TestException(); } } For the above code, fill in the blank with one option.?

  1. Error

  2. Exception

  3. RuntimeException

  4. Object

7. What will be the result of compiling and executing the following program package com.udayan.oca; import java.io.FileNotFoundException; import java.io.IOException; abstract class Super { public abstract void m1() throws IOException; } class Sub extends Super { @Override public void m1() throws IOException { throw new FileNotFoundException(); } } public class Test { public static void main(String[] args) { Super s = new Sub(); try { s.m1(); } catch (IOException e) { System.out.print("A"); } catch(FileNotFoundException e) { System.out.print("B"); } finally { System.out.print("C"); } } } ?

  1. class Test gives compilation error

  2. BC

  3. AC

  4. class Sub gives compilation error

8. Given code of Test.java file: package com.udayankhattry.oca; import java.util.ArrayList; import java.util.List; public class Test { public static void main(String[] args) { List<StringBuilder> list = new ArrayList<>(); list.add(new StringBuilder("AAA")); //Line n1 list.add(new StringBuilder("BBB")); //Line n2 list.add(new StringBuilder("AAA")); //Line n3 list.removeIf(sb -> sb.equals(new StringBuilder("AAA"))); //Line n4 System.out.println(list); } } What will be the result of compiling and executing Test class?

  1. None of the other options

  2. [BBB]

  3. [AAA, BBB, AAA]

  4. [BBB, AAA]

  5. []

9. Consider below code of Guest.java file: //Guest.java class Message { static void main(String [] args) { System.out.println("Welcome " + args[2] + "!"); } } public class Guest { public static void main(String [] args) { Message.main(args); } } And the commands: javac Guest.java java Guest Clare Waight Keller What is the result?

  1. Welcome Clare!

  2. Compilation error as main method is not public in Message class

  3. ArrayIndexOutOfBoundsException is thrown at runtime

  4. Some other error as main method can't be invoked manually

  5. Welcome Waight!

  6. Welcome Keller!

10. What will be the result of compiling and executing Test class package com.udayan.oca; public class Test { public static void main(String[] args) { Double [] arr = new Double[2]; System.out.println(arr[0] + arr[1]); } } ?

  1. 0.0

  2. ClassCastException is thrown at runtime

  3. Compilation error

  4. NullPointerException is thrown at runtime

11. What will be the result of compiling and executing Test class package com.udayan.oca; public class Test { public static void main(String[] args) { System.out.println(new Boolean("ture")); } } ?

  1. An exception is thrown at runtime

  2. true

  3. Compilation error

  4. false

12. What will be the result of compiling and executing Test class //Test.java package com.udayan.oca; class Parent { int i = 10; Parent(int i) { super(); this.i = i; } } class Child extends Parent { int j = 20; Child(int j) { super(0); this.j = j; } Child(int i, int j) { super(i); this(j); } } public class Test { public static void main(String[] args) { Child child = new Child(1000, 2000); System.out.println(child.i + ":" + child.j); } } ?

  1. Compilation error for Test class

  2. 1000:2000

  3. 1000:0

  4. Compilation error for Parent(int) constructor

  5. Compilation error for Child(int) constructor

  6. Compilation error for Child(int, int) Constructor

13. Consider below code of Test.java file: package com.udayan.oca; class Document { int pages; Document(int pages) { this.pages = pages; } } class Word extends Document { String type; Word(String type) { super(20); //default pages /*INSERT-1*/ } Word(int pages, String type) { /*INSERT-2*/ super.pages = pages; } } public class Test { public static void main(String[] args) { Word obj = new Word(25, "TEXT"); System.out.println(obj.type + "," + obj.pages); } } Currently above code causes compilation error. Which of the options can successfully print TEXT,25 on to the console?

  1. Replace /*INSERT-1*/ with: super.type = type; Replace /*INSERT-2*/ with: this(type);

  2. Replace /*INSERT-1*/ with: super.type = type; Replace /*INSERT-2*/ with: super(type);

  3. None of the other options

  4. Replace /*INSERT-1*/ with: this.type = type; Replace /*INSERT-2*/ with: this(type);

  5. Replace /*INSERT-1*/ with: this(type); Replace /*INSERT-2*/ with: this.type = type;

14. Consider below code: //Test.java package com.udayan.oca; import java.time.LocalDate; import java.time.LocalTime; public class Test { public static void main(String [] args) { LocalDate date = LocalDate.parse("1947-08-14"); LocalTime time = LocalTime.MAX; System.out.println(date.atTime(time)); } } What will be the result of compiling and executing Test class?

  1. 1947-08-14T23:59:59

  2. 1947-08-14T23:59:59.999999999

  3. 1947-08-14T23:59:59.0

  4. 1947-08-14T23:59:59.999

15. What will be the result of compiling and executing Test class package com.udayan.oca; public class Test { public static void main(String[] args) { String s1 = "OcA"; String s2 = "oCa"; System.out.println(s1.equals(s2)); } } ?

  1. FALSE

  2. TRUE

  3. None of the other options

  4. Compilation error

16. What will be the result of compiling and executing Bonus class? package com.udayan.oca; public class Bonus { public static void main(String[] args) { int $ = 80000; String msg = ($ >= 50000) ? "Good bonus" : "Average bonus"; System.out.println(msg); } }

  1. Compilation error

  2. Average bonus

  3. Good bonus

17. What will be the result of compiling and executing Test class package com.udayan.oca; class A { A() { this(1); System.out.println("M"); } A(int i) { System.out.println("N"); } } class B extends A { } public class Test { public static void main(String[] args) { new B(); } } ?

  1. N M

  2. M N

  3. N

  4. M

18. Consider below code of Test.java file: package com.udayankhattry.oca; public class Test { public static void main(String[] args) { String arr1 [], arr2, arr3 = null; //Line n1 arr1 = new String[2]; arr1[0] = "A"; arr1[1] = "B"; arr2 = arr3 = arr1; //Line n2 log(arr2); //Line n3 } private static void log(String... vals) { for(String s : vals) System.out.print(s); } } What will be the result of compiling and executing Test class?

  1. Line n1 causes compilation error

  2. It executes successfully and prints AB on to the console

  3. It executes successfully and prints BA on to the console

  4. It executes successfully and prints B on to the console

  5. Line n2 causes compilation error

  6. It executes successfully and prints A on to the console

19. Consider the code of Test.java file: package com.udayan.oca; class Student { String name; int age; Student() { Student("James", 25); } Student(String name, int age) { this.name = name; this.age = age; } } public class Test { public static void main(String[] args) { Student s = new Student(); System.out.println(s.name + ":" + s.age); } } What will be the result of compiling and executing Test class?

  1. null:0

  2. James:25

  3. An exception is thrown at runtime

  4. Compilation error

20. What will be the result of compiling and executing Test class package com.udayan.oca; public class Test { public static void main(String[] args) { String [] arr = new String[7]; System.out.println(arr); } } ?

  1. null

  2. Compilation Error

  3. Some String containing @ symbol

  4. NullPointerException

21. Consider below codes of 3 java files: //Sellable.java package com.udayankhattry.oca; public interface Sellable { double getPrice(); default String symbol() { return "$"; } } //Chair.java package com.udayankhattry.oca; public class Chair implements Sellable { public double getPrice() { return 35; } public String symbol() { return "£"; } } //Test.java package com.udayankhattry.oca; public class Test { public static void main(String[] args) { Sellable obj = new Chair(); //Line n1 System.out.println(obj.symbol() + obj.getPrice()); //Line n2 } } What will be the result of compiling and executing Test class?

  1. It compiles successfully and on execution prints $35.00 on to the console

  2. It compiles successfully and on execution prints $35.0 on to the console

  3. Compilation error in Test class

  4. It compiles successfully and on execution prints £35 on to the console

  5. Compilation error in Chair class

  6. It compiles successfully and on execution prints £35.0 on to the console

22. Consider below codes of 3 java files: //Shrinkable.java package com.udayankhattry.oca; public interface Shrinkable { public static void shrinkPercentage() { System.out.println("80%"); } } //AntMan.java package com.udayankhattry.oca; public class AntMan implements Shrinkable { } //Test.java package com.udayankhattry.oca; public class Test { public static void main(String[] args) { AntMan.shrinkPercentage(); } } Which of the following statements is correct?

  1. There is a compilation error in Shrinkable.java file

  2. There is a compilation error in AntMan.java file

  3. There is a compilation error in Test.java file

  4. There is no compilation error and on execution, Test class prints 80% on to the console

23. Consider below code of Test.java file: package com.udayankhattry.oca; import java.time.LocalDate; public class Test { public static void main(String [] args) { LocalDate date = LocalDate.parse("2020-08-31"); System.out.println(date.plusMonths(-6)); } } What is the result?

  1. 2020-02-29

  2. 2020-02-31

  3. An exception is thrown at runtime

  4. Compilation error

  5. 2020-02-28

  6. 2020-02-30

24. Given the following definitions of the class Insect and the interface Flyable, the task is to declare a class Mosquito that inherits from the class Insect and implements the interface Flyable. class Insect {} interface Flyable {} Select the correct option to accomplish this task: ?

  1. class Mosquito implements Insect extends Flyable{}

  2. class Mosquito extends Insect, Flyable{}

  3. class Mosquito extends Insect implements Flyable{}

  4. class Mosquito implements Insect, Flyable{}

25. Which of the following are Java Exception classes Select 3 options. ?

  1. NumberFormatException

  2. IllegalArgumentException

  3. ClassCastException

  4. NullException

  5. ArrayIndexException

FAQs


1. What is the Oracle Certified Associate Java SE 8 Programmer 1Z0-808 certification?

The Oracle 1Z0-808 certification validates your fundamental knowledge of Java programming, including object-oriented principles, syntax, and core Java concepts for building robust applications.

2. How do I become an Oracle Certified Associate Java SE 8 certified professional?

You must pass the 1Z0-808: Java SE 8 Programmer I exam, which measures your ability to code, debug, and use Java to create object-oriented applications.

3. What are the prerequisites for the Oracle Java SE 8 1Z0-808 exam?

There are no formal prerequisites. However, familiarity with basic programming concepts and Java syntax is highly recommended before attempting the exam.

4. How much does the Oracle Certified Associate Java SE 8 1Z0-808 exam cost?

The exam costs around $245 USD, though prices may vary based on region and currency.

5. How many questions are in the Oracle 1Z0-808 exam, and what is the time limit?

The exam includes 70 multiple-choice questions, and you’ll have 150 minutes to complete it.

6. What topics are covered in the Oracle Certified Associate Java SE 8 certification exam?

Key topics include Java basics, object-oriented programming, operators, loops, arrays, methods, inheritance, and exception handling.

7. How difficult is the Oracle Certified Associate Java SE 8 1Z0-808 exam?

It’s considered a beginner to intermediate-level certification, suitable for new programmers looking to start their career in Java development.

8. How long does it take to prepare for the Oracle Java SE 8 1Z0-808 certification exam?

Most candidates prepare in 6–10 weeks, depending on their prior Java knowledge and hands-on coding experience.

9. What jobs can I get after earning the Oracle Certified Associate Java SE 8 certification?

You can work as a Java Developer, Software Engineer, Application Developer, or Junior Programmer in software development companies.

10. What is the average salary of an Oracle Certified Associate Java SE 8 certified professional?

Certified Java professionals typically earn between $80,000–$110,000 per year, depending on experience and role.


Recent Posts

See All

Comments

Rated 0 out of 5 stars.
No ratings yet

Add a rating
CertiMaan Logo

​​

Terms Of Use     |      Privacy Policy     |      Refund Policy    

   

 Copyright © 2011 - 2025  Ira Solutions -   All Rights Reserved

Disclaimer:: 

The content provided on this website is for educational and informational purposes only. We do not claim any affiliation with official certification bodies, including but not limited to Pega, Microsoft, AWS, IBM, SAP , Oracle , PMI, or others.

All practice questions, study materials, and dumps are intended to help learners understand exam patterns and enhance their preparation. We do not guarantee certification results and discourage the misuse of these resources for unethical purposes.

PayU logo
Razorpay logo
bottom of page