All Practice Exams

100+ Free Java SE 8 Programmer I (OCAJP 8) Practice Questions

Pass your Oracle Certified Associate, Java SE 8 Programmer I (Exam 1Z0-808) exam on the first try — instant access, no signup required.

✓ No registration✓ No credit card✓ No hidden fees✓ Start practicing immediately
100+ Questions
100% Free
1 / 100
Question 1
Score: 0/0

Which constructor call correctly invokes another constructor in the SAME class from within a constructor?

A
B
C
D
to track
2026 Statistics

Key Facts: Java SE 8 Programmer I (OCAJP 8) Exam

$245

Exam Fee (USD)

Oracle

65%

Passing Score

Oracle

~56

Question Count

Oracle University exam page

150 min

Exam Duration

Oracle

No expiry

Certification Validity

Oracle (certifications are perpetual)

9 objectives

Exam Topic Areas

Oracle exam blueprint

Oracle lists Exam 1Z0-808 (Java SE 8 Programmer I, OCAJP 8) as an associate certification delivered through Pearson VUE, with a 65% passing score, roughly 56 questions, a 150-minute time limit, and a $245 USD fee. The nine objectives span Java Basics, data types, operators and decisions, arrays, loops, methods and encapsulation, inheritance, exception handling, and selected Java API classes including String, StringBuilder, ArrayList, and java.time. The credential does not expire and is the prerequisite for the OCP 1Z0-809 exam.

Sample Java SE 8 Programmer I (OCAJP 8) Practice Questions

Try these sample questions to test your Java SE 8 Programmer I (OCAJP 8) exam readiness. Each question includes a detailed explanation. Start the interactive quiz above for the full 100+ question experience with AI tutoring.

1Which statement about the main method required to launch a Java SE 8 application from the command line is correct?
A.public static void main(String[] args)
B.public void main(String[] args)
C.static public int main(String args)
D.public static void Main(String[] args)
Explanation: The JVM looks for a method with the exact signature public static void main(String[] args). It must be public, static, return void, and accept a single String array parameter. The parameter name is arbitrary but the type must be String[] (or String...).
2Given a source file containing one public class named Report, what must the file be named to compile successfully?
A.report.java
B.Report.j
C.Report.class
D.Report.java
Explanation: A Java source file must have the same name as its public top-level class, with the .java extension and matching case. So a public class Report must live in Report.java. The compiler produces Report.class as output, but the source file itself ends in .java.
3In a Java source file, which ordering of elements is required for the file to compile?
A.import statements, then package statement, then class declaration
B.package statement, then class declaration, then import statements
C.class declaration, then package statement, then import statements
D.package statement, then import statements, then class declaration
Explanation: When present, the package statement must come first, followed by any import statements, then the type (class/interface) declarations. Comments may appear anywhere. This fixed order is enforced by the compiler.
4Which import statement correctly imports only the ArrayList class from the java.util package?
A.import java.util.*.ArrayList;
B.import static java.util.ArrayList;
C.import java.util.ArrayList.*;
D.import java.util.ArrayList;
Explanation: A single-type import names the package path followed by the exact class name: import java.util.ArrayList;. The wildcard * can replace the class name to import all types in the package, but cannot be combined with a specific class name.
5Which package is automatically imported into every Java source file without an explicit import statement?
A.java.util
B.java.io
C.java.lang
D.java.time
Explanation: The java.lang package is implicitly imported into every compilation unit, which is why String, System, Integer, Math, and Object can be used without any import. All other packages, including java.util, java.io, and java.time, require an explicit import.
6What is the output of: System.out.println(args.length); when a program is run as: java App one two three
A.4
B.A NullPointerException is thrown
C.0
D.3
Explanation: Command-line arguments populate the String[] args array, and the program name (App) is NOT included. The three arguments one, two, and three give args.length a value of 3. Unlike C, the executable name is not part of the argument array.
7Which of the following is a valid Java identifier?
A.2ndValue
B.my-value
C._count1
D.class
Explanation: A legal Java identifier must begin with a letter, dollar sign ($), or underscore (_), followed by letters, digits, dollar signs, or underscores. _count1 starts with an underscore and is therefore valid. It also must not be a reserved keyword.
8Which statement about a Java class that has no explicitly declared constructor is true?
A.The class cannot be instantiated until a constructor is added
B.The class will fail to compile
C.The compiler supplies a constructor that takes all fields as arguments
D.The compiler supplies a default no-argument constructor
Explanation: If a class declares no constructors at all, the Java compiler automatically inserts a default constructor that takes no arguments and has an empty body (it just calls super()). As soon as you declare any constructor yourself, the default is no longer provided.
9Which line is a valid single-line comment in Java?
A.# this is a comment
B.** this is a comment **
C.<!-- this is a comment -->
D.// this is a comment
Explanation: Java uses // for single-line comments and /* ... */ for multi-line (block) comments, with /** ... */ for Javadoc. The // form comments out everything to the end of the line.
10A class Order is declared in package com.shop.sales. From a class in package com.shop.web, how can Order be referenced without an import?
A.By writing com.shop.sales.Order as the fully qualified name
B.It cannot be referenced at all from another package
C.By writing sales.Order
D.By writing Order directly because all com.shop subpackages share a namespace
Explanation: Without an import statement, a type from another package can still be used by writing its fully qualified name: com.shop.sales.Order. The import statement is merely a convenience that lets you use the simple name Order instead.

About the Java SE 8 Programmer I (OCAJP 8) Exam

Exam 1Z0-808 leads to the Oracle Certified Associate, Java SE 8 Programmer I (OCAJP 8) credential, validating foundational Java SE 8 programming skills. The blueprint covers Java Basics such as the main method, packages, and imports; Java data types including primitives, wrappers, casting, and scope; operators and decision constructs; one-dimensional and multidimensional arrays; for, while, and do/while loops; methods and encapsulation; inheritance with polymorphism, casting, abstract classes, and interfaces; exception handling; and selected Java API classes like String, StringBuilder, Arrays, ArrayList, and the java.time date/time API. Passing 1Z0-808 is the prerequisite step before the OCP 1Z0-809 exam.

Questions

56 scored questions

Time Limit

150 minutes

Passing Score

65%

Exam Fee

$245 (Oracle)

Java SE 8 Programmer I (OCAJP 8) Exam Content Outline

15%

Working with Java Data Types

Declare and initialize primitives and wrapper classes, apply casting and numeric promotion, understand field versus local-variable defaults, variable scope, autoboxing, the Integer cache, and pass-by-value semantics.

15%

Working with Methods and Encapsulation

Create overloaded methods and resolve overloads, apply the static keyword to methods and fields, create and overload constructors, apply access modifiers, and apply encapsulation using private fields with public accessors.

15%

Working with Inheritance

Use polymorphism and runtime method dispatch, override methods correctly, distinguish reference type from object type, cast references safely, use super and this, and work with abstract classes and Java 8 interfaces including default and static methods.

10%

Java Basics

Write a valid main method, structure source files to match the public class name, order package and import statements correctly, and rely on the implicitly imported java.lang package.

10%

Using Operators and Decision Constructs

Apply Java operators and precedence, use parentheses to override precedence, compare objects with == versus equals, and build if/else, ternary, and switch constructs including fall-through behavior.

10%

Using Loop Constructs

Create and compare for, enhanced for, while, and do/while loops, and control flow with break, continue, and labeled statements.

10%

Handling Exceptions

Differentiate checked exceptions, unchecked exceptions, and Errors, build try/catch/finally blocks, understand finally-return override, and recognize common exceptions like NullPointerException, ArithmeticException, and ArrayIndexOutOfBoundsException.

10%

Working with Selected Classes from the Java API

Create and manipulate Strings and StringBuilder, use the Arrays utility class and ArrayList, write simple lambda and Predicate expressions, and create and manipulate calendar data with LocalDate, LocalTime, LocalDateTime, DateTimeFormatter, and Period.

5%

Creating and Using Arrays

Declare, instantiate, initialize, and use one-dimensional and multidimensional arrays including jagged arrays, and handle array bounds and default element values.

How to Pass the Java SE 8 Programmer I (OCAJP 8) Exam

What You Need to Know

  • Passing score: 65%
  • Exam length: 56 questions
  • Time limit: 150 minutes
  • Exam fee: $245

Keys to Passing

  • Complete 500+ practice questions
  • Score 80%+ consistently before scheduling
  • Focus on highest-weighted sections
  • Use our AI tutor for tough concepts

Java SE 8 Programmer I (OCAJP 8) Study Tips from Top Performers

1Trace code output by hand for every practice question; 1Z0-808 heavily tests reading code and predicting output, compile errors, or runtime exceptions rather than reciting definitions.
2Spend the most prep time on the three 15% objectives: data types, methods and encapsulation, and inheritance, which together account for nearly half the exam.
3Master the classic traps: String immutability (concat without assignment), the Integer cache (-128 to 127), finally blocks overriding a return, and ArrayList.remove(int index) versus remove(Object).
4Know the exception hierarchy cold: Throwable at the top, Error and Exception below it, and which common exceptions are checked (IOException) versus unchecked (NullPointerException, ArithmeticException, ArrayIndexOutOfBoundsException).
5Memorize the rules for constructors and inheritance: an implicit super() call, this() and super() must be first, default constructor insertion, and parent-then-child constructor execution order.
6Practice the java.time API and remember its types are immutable, so methods like plusDays and plus return new objects and never modify the original LocalDate or LocalDateTime.

Frequently Asked Questions

What are the current exam facts for 1Z0-808?

Oracle lists Exam 1Z0-808 as the Java SE 8 Programmer I (OCAJP 8) associate certification with a 65% passing score, roughly 56 questions, a 150-minute time limit, and a $245 USD fee, delivered through Pearson VUE.

What does the 1Z0-808 exam measure?

It validates foundational Java SE 8 skills across nine objectives: Java Basics, data types, operators and decision constructs, arrays, loops, methods and encapsulation, inheritance, exception handling, and selected Java API classes.

How many questions are on 1Z0-808 and what score do I need?

Oracle's exam page lists approximately 56 questions and a 65% passing score, with a 150-minute time limit. Questions are multiple choice and multiple select with realistic code scenarios.

Does the OCAJP 8 certification expire?

No. Oracle Java certifications are perpetual and do not expire once earned, so an OCAJP 8 holder remains OCAJP 8 certified indefinitely.

Is 1Z0-808 a prerequisite for any other exam?

Yes. Passing 1Z0-808 (OCAJP 8) is the required first step before taking the Oracle Certified Professional, Java SE 8 Programmer II exam (1Z0-809).

What is the best way to prepare for 1Z0-808?

Write and run small Java programs for each objective and trace output by hand, since the exam tests code reading, compile errors, and edge cases like finally-return override, the Integer cache, and ArrayList.remove(int) versus remove(Object).