All Practice Exams

Free Practice Questions for Oracle Java Foundations

Exam-style questions and explanations by OpenExamPrep.

✓ No registration✓ No credit card
130+ Questions
100% Free
Exam Review

Key Facts: Oracle Java Foundations Exam

$95

Exam Fee (USD)

Oracle

65%

Passing Score

Oracle

120 min

Exam Duration

Oracle

60

Question Count

Oracle University

JDK 8

Validated Platform

Oracle

No expiration

Credential Validity

Oracle

Oracle lists Exam 1Z0-811 (Java Certified Foundations Associate) as a novice-level, multiple-choice exam with a 65% passing score and a $95 USD fee, validated for JDK 8. It presents about 60 questions in 120 minutes and has no prerequisites. Topic areas include Java basics, data types and Strings, operators and decision statements, arrays and ArrayLists, loops, methods, object-oriented programming, and debugging and exception handling. The credential does not expire.

Sample Oracle Java Foundations Practice Questions

Try these sample questions to review concepts for the Oracle Java Foundations exam. Each question includes a detailed explanation. Start the interactive quiz above for the full 130+ question experience with AI tutoring.

1Which Java tool is used to compile a source file named Hello.java into bytecode?
A.javac
B.java
C.javadoc
D.jar
Explanation: The javac compiler translates a .java source file into a .class file containing platform-independent bytecode. You compile Hello.java with the command 'javac Hello.java', which produces Hello.class.
2After compiling a class named Main, which command runs the program on the JVM?
A.java Main.class
B.javac Main
C.java Main
D.run Main
Explanation: You launch a compiled program with 'java Main', passing the fully qualified class name without the .class extension. The java launcher loads Main.class, starts the JVM, and invokes its main method.
3What does the acronym JVM stand for in the Java platform?
A.Java Virtual Machine
B.Java Virtual Memory
C.Java Verification Module
D.Java Version Manager
Explanation: JVM stands for Java Virtual Machine. It loads and executes Java bytecode. A platform-specific JVM that supports the class-file version and required libraries can run the same compiled application on different platforms.
4In the Java SE 8 distribution, which statement best describes the relationship between the JDK and the JRE?
A.The JDK includes the JRE plus development tools such as the compiler
B.The JRE includes the JDK plus a debugger
C.The JDK and JRE are two names for the same product
D.The JRE compiles code while the JDK only runs it
Explanation: In Java SE 8, the JDK (Java Development Kit) includes the runtime environment plus development tools such as javac, javadoc and the debugger. The standalone JRE (Java Runtime Environment) supplies the JVM and libraries to run applications, without those JDK development tools.
5Which of the following is a key feature commonly attributed to the Java language?
A.Platform independence through bytecode and the JVM
B.Manual memory management with explicit free calls
C.Compilation directly to a single platform's machine code
D.Absence of any object-oriented features
Explanation: Java source normally compiles to platform-neutral bytecode. A compatible JVM and the required libraries allow the same compiled program to run on different operating systems and hardware. Java also supports automatic memory management and object-oriented programming.
6What is Java's automatic reclamation of memory occupied by objects that are no longer reachable called?
A.Garbage collection
B.Stack unwinding
C.Manual deallocation
D.Reference counting by the programmer
Explanation: Garbage collection reclaims memory occupied by objects that can no longer be reached by the running program. Developers do not manually free objects. Objects that remain reachable, even if the program no longer needs them, can still cause memory leaks.
7For a conventional Java SE 8 application, which declaration is a valid main entry-point method?
A.public static void main(String[] args)
B.public void main(String args)
C.static public main(String[] args)
D.public static int main(String[] args)
Explanation: A conventional Java SE 8 application entry point is public and static, returns void, and takes one String array (or equivalent String varargs parameter). The launcher can invoke it without creating an instance of the application class.
8A source file contains a single public class named Account. What must the source file be named?
A.Account.java
B.account.java
C.Main.java
D.Account.class
Explanation: When a source file contains a public class, the file name must exactly match the public class name, including capitalization, with a .java extension. So a public class Account must live in Account.java, or the file will not compile.
9Which statement correctly prints a line of text and then moves to a new line in the console?
A.System.out.println("Hello");
B.System.out.print("Hello");
C.Console.writeLine("Hello");
D.print("Hello")
Explanation: System.out.println outputs its argument followed by a line terminator, advancing the cursor to the next line. System.out is a PrintStream connected to standard output, and println is its method for printing with a trailing newline.
10Which of the following is a correctly written 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 // to begin a single-line comment; everything from // to the end of the line is ignored by the compiler. Java also supports /* ... */ for block comments and /** ... */ for Javadoc comments.

About the Oracle Java Foundations Exam

Exam 1Z0-811 leads to the Java Certified Foundations Associate credential, a novice-level certification that validates the fundamentals of Java programming. The blueprint covers Java basics such as the JDK, JRE, and JVM and compiling and running programs; working with data types, casting, and the String class; operators and decision statements; arrays and ArrayLists; for, while, and do-while loops; methods, scope, and overloading; object-oriented programming with classes, constructors, encapsulation, and inheritance; and debugging, documentation, and exception handling. The exam is validated for JDK 8 and is aimed at students and beginners, including Oracle Academy participants. Questions are entry level and simpler than the associate-level 1Z0-808.

Exam sponsor: Oracle. The requirements and fees below concern the certification or admission exam, separate from our free practice resources.

Questions

60 questions

Time Limit

120 minutes

Passing Score

65%

Exam / Certification Fees

$95

Exam sponsor website

Fees, eligibility, and exam policies can change. Confirm them with the exam sponsor before applying or paying.

Our practice resources: topics covered

We aim to reflect publicly available exam outlines and topic information in our study resources. Coverage, format, and difficulty may differ from the actual exam, and we cannot guarantee that every detail is accurate or current. Confirm exam requirements, fees, and policies with the official exam sponsor.

12%

Java Basics, What Is Java, and Basic Java Elements

Describe Java's key features and platforms, distinguish the JDK, JRE, and JVM, explain bytecode and garbage collection, identify the parts of a basic program including the main method, and compile with javac and run with the java launcher.

13%

Working with Java Data Types and the String Class

Declare and initialize variables, use final for constants, work with the eight primitive types and their defaults, perform widening and narrowing casts, declare Strings, and call String methods such as length, equals, compareTo, and Integer.parseInt.

15%

Working with Java Operators and Decision Statements

Apply arithmetic, increment and decrement, relational, compound assignment, and conditional operators, respect operator precedence, and build decisions with if-then-else, switch, and the ternary operator.

12%

Working with Java Arrays and ArrayLists

Declare and create one-dimensional and two-dimensional arrays, access elements and the length field, handle out-of-bounds errors, create and manipulate an ArrayList with add and get, and compare arrays with ArrayLists.

13%

Using Looping Statements

Write for, enhanced for, while, and do-while loops, nest loops, trace iteration counts, and direct flow using break and continue while choosing the right loop for the task.

12%

Working with Methods

Declare methods with parameters and return types, understand void and pass-by-value, overload methods, call static methods, and reason about local variable scope and code reuse.

13%

Object-Oriented Programming, Classes, and Constructors

Create classes and objects with new, write constructors and rely on the default constructor, apply encapsulation with private fields and getters and setters, use this and inheritance with extends, and distinguish instance from static members.

10%

Debugging, Documentation, and Exception Handling

Tell syntax errors from logic errors, read a stack trace, write Javadoc comments and tags such as @param and @return, handle common exceptions with try-catch-finally, and use the Math and Random utility classes.

Preparing for the Oracle Java Foundations Exam

What You Need to Know

  • Passing score: 65%
  • Exam length: 60 questions
  • Time limit: 120 minutes
  • Exam / certification fees: $95 Official sources

Using Our Practice Resources

  • Work through all 130 available questions
  • Review every answer and explanation
  • Track weak areas and revisit them
  • Use our AI tutor for tough concepts

Oracle Java Foundations: Suggested Study Strategy

1Install JDK 8, then compile with javac and run with the java launcher so commands, the main method signature, and the file-name rule become second nature.
2Drill the eight primitive types, their default values, and widening versus narrowing casts; remember that int division truncates and that (int) on a double drops the fraction.
3Practice String methods such as length, equals versus ==, compareTo, and Integer.parseInt, and know that string concatenation with + converts the other operand to text.
4Trace loops by hand to count exact iterations, including nested loops and the difference between while and do-while, and watch how break and continue change flow.
5Build a small class with private fields, a constructor, getters and setters, and the this keyword to internalize encapsulation, instance versus static, and inheritance with extends.
6Learn to read a stack trace and recognize common exceptions such as NullPointerException, ArithmeticException, and ArrayIndexOutOfBoundsException, plus how try-catch-finally behaves.

Frequently Asked Questions

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

Oracle lists Exam 1Z0-811, the Java Certified Foundations Associate, as a novice-level multiple-choice exam with a 65% passing score and a $95 USD fee. It presents about 60 questions in 120 minutes and is validated for JDK 8.

Is the Oracle Java Foundations certification good for beginners?

Yes. 1Z0-811 is designed for beginners, students in secondary schools and two-year colleges, and Oracle Academy participants. It tests entry-level Java fundamentals and is simpler than the associate-level 1Z0-808 (OCA Java SE 8).

What topics does the 1Z0-811 exam cover?

The exam covers Java basics, data types and the String class, operators and decision statements, arrays and ArrayLists, loops, methods, object-oriented programming with classes and constructors, and debugging and exception handling.

Does the Java Foundations certification expire?

No. The Java Certified Foundations Associate credential does not retire or expire. However, it is validated for JDK 8, so it reflects Java 8 fundamentals rather than newer language features.

How is 1Z0-811 different from 1Z0-808 (OCA)?

1Z0-811 is a foundations-level exam for beginners covering core syntax and concepts, while 1Z0-808 (Java SE 8 Programmer I) is a deeper associate-level exam. Many learners take 1Z0-811 first, then progress to the OCA.

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

Write and run small Java programs for every objective: declare variables, cast values, build loops, create classes and constructors, and handle exceptions. Then drill practice questions and study why each wrong option is wrong until the syntax feels routine.