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?
Four initializer blocks cause compilation error.
Five initializer blocks cause compilation error.
Two initializer blocks cause compilation error.
Only one initializer block causes compilation error.
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?
INHALE-EXHALE-INHALE-
INHALE-EXHALE-EXHALE
INHALE-EXHALE
INHALE-EXHALE-
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?
Three statements
Only one statement
Four statements
Five statements
All six statements
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); } } ?
[orange, mango, banana, grape]
[orange, grape, mango, banana]
An exception is thrown at runtime
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(); } } ?
Animal Deer
Cat Animal
Animal Animal
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.?
Error
Exception
RuntimeException
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"); } } } ?
class Test gives compilation error
BC
AC
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?
None of the other options
[BBB]
[AAA, BBB, AAA]
[BBB, AAA]
[]
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?
Welcome Clare!
Compilation error as main method is not public in Message class
ArrayIndexOutOfBoundsException is thrown at runtime
Some other error as main method can't be invoked manually
Welcome Waight!
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]); } } ?
0.0
ClassCastException is thrown at runtime
Compilation error
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")); } } ?
An exception is thrown at runtime
true
Compilation error
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); } } ?
Compilation error for Test class
1000:2000
1000:0
Compilation error for Parent(int) constructor
Compilation error for Child(int) constructor
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?
Replace /*INSERT-1*/ with: super.type = type; Replace /*INSERT-2*/ with: this(type);
Replace /*INSERT-1*/ with: super.type = type; Replace /*INSERT-2*/ with: super(type);
None of the other options
Replace /*INSERT-1*/ with: this.type = type; Replace /*INSERT-2*/ with: this(type);
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?
1947-08-14T23:59:59
1947-08-14T23:59:59.999999999
1947-08-14T23:59:59.0
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)); } } ?
FALSE
TRUE
None of the other options
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); } }
Compilation error
Average bonus
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(); } } ?
N M
M N
N
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?
Line n1 causes compilation error
It executes successfully and prints AB on to the console
It executes successfully and prints BA on to the console
It executes successfully and prints B on to the console
Line n2 causes compilation error
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?
null:0
James:25
An exception is thrown at runtime
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); } } ?
null
Compilation Error
Some String containing @ symbol
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?
It compiles successfully and on execution prints $35.00 on to the console
It compiles successfully and on execution prints $35.0 on to the console
Compilation error in Test class
It compiles successfully and on execution prints £35 on to the console
Compilation error in Chair class
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?
There is a compilation error in Shrinkable.java file
There is a compilation error in AntMan.java file
There is a compilation error in Test.java file
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?
2020-02-29
2020-02-31
An exception is thrown at runtime
Compilation error
2020-02-28
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: ?
class Mosquito implements Insect extends Flyable{}
class Mosquito extends Insect, Flyable{}
class Mosquito extends Insect implements Flyable{}
class Mosquito implements Insect, Flyable{}
25. Which of the following are Java Exception classes Select 3 options. ?
NumberFormatException
IllegalArgumentException
ClassCastException
NullException
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.

Comments