All Practice Exams

100+ Free Oracle Java Foundations Practice Questions

Pass your Oracle Certified Foundations Associate, Java (Exam 1Z0-811) 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

What does "Hello".length() return?

A
B
C
D
to track
2026 Statistics

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 test your Oracle Java Foundations exam readiness. Each question includes a detailed explanation. Start the interactive quiz above for the full 100+ 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 Variable Manager
C.Java Verified Module
D.Just Valid Method
Explanation: JVM stands for Java Virtual Machine, the abstract computing machine that loads and executes Java bytecode. Because each platform has its own JVM implementation, the same compiled bytecode runs anywhere, giving Java its 'write once, run anywhere' portability.
4Which 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: The JDK (Java Development Kit) is a superset of the JRE (Java Runtime Environment). It bundles everything needed to run Java applications plus development tools such as the javac compiler, javadoc, and the debugger, which the JRE alone does not provide.
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 is platform independent: source code compiles to bytecode that any JVM can execute, regardless of the underlying operating system or hardware. This 'write once, run anywhere' capability is one of Java's defining features, along with automatic garbage collection and being object-oriented.
6Java's automatic reclamation of memory occupied by objects that are no longer referenced is called what?
A.Garbage collection
B.Stack unwinding
C.Manual deallocation
D.Reference counting by the programmer
Explanation: Garbage collection is the JVM process that automatically frees heap memory used by objects no longer reachable from the running program. This relieves developers from manually deleting objects and helps prevent memory leaks and dangling-pointer bugs common in languages with manual memory management.
7In a runnable Java application, what is the exact signature of the entry-point method that the JVM calls first?
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: The JVM looks for 'public static void main(String[] args)' as the application entry point. It must be public so the JVM can access it, static so no object is required, return void, and accept a String array for command-line arguments.
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.

Questions

60 scored questions

Time Limit

120 minutes

Passing Score

65%

Exam Fee

$95 (Oracle)

Oracle Java Foundations Exam Content Outline

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.

How to Pass the Oracle Java Foundations Exam

What You Need to Know

  • Passing score: 65%
  • Exam length: 60 questions
  • Time limit: 120 minutes
  • Exam fee: $95

Keys to Passing

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

Oracle Java Foundations Study Tips from Top Performers

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.