Limited-Time Offer: Enjoy 50% Savings! - Ends In 0d 00h 00m 00s Coupon code: 50OFF
Welcome to QA4Exam

Exam preparation

Oracle 1Z0-811 Exam Guide for the Java

1Z0-811 is the Oracle Java Foundations exam, part of the Oracle Java certification. You get 60 questions and 120 minutes. The official outline has 13 exam topics. For your exam preparation, each topic below links to its own free practice questions. 13 are online now, with answers and explanations.

1Z0-811 Exam Details

Vendor
Oracle
Exam Code
1Z0-811
Real Exam Questions
60
Time Limit
120 min
Free Practice Questions
13
Full Question Set
75
Exam Topics
13
Last Updated
December 1, 2026
Exam Name
Java Foundations
Question Types
MCQs
Certification
Oracle Java

1Z0-811 Exam Topics and Weights

What Is Java?

What this topic covers

Explain Java’s core features and where Java applications are used. Describe how compiling source code to bytecode lets compatible JVMs run it across platforms.

Why can one compiled Java program run on Windows and Linux without changes?

Java source is compiled to bytecode, and any machine with a compatible Java Virtual Machine (JVM) can run that bytecode. The JVM translates the bytecode for the local operating system, so the same .class file works on each platform. The compiled file is not tied to one operating system, which is the platform independence Java is known for.

1 free 1Z0-811 practice question on What Is Java?

Java Basics

What this topic covers

Distinguish the JDK tools, such as javac, from the runtime components that execute bytecode. Identify object-oriented programming concepts and the parts of a basic program, then compile and run it.

What is the difference between the JDK and the JRE?

The JDK is the development kit, and it includes tools such as javac, the compiler. The JRE provides the JVM and the libraries needed to run compiled bytecode. You need the JDK to write and compile programs, while the JRE is enough only to execute them.

1 free 1Z0-811 practice question on Java Basics

Basic Java Elements

What this topic covers

Apply Java naming and syntax conventions, reserved words, and comments. Place imports correctly and recognize how packages, including java.lang, make classes available to a program.

Where does an import declaration go in a Java source file?

An import declaration goes after any package declaration and before the type declaration. For example, the package line comes first, then import java.util.ArrayList, then the class. Putting the import inside the class body causes a compile error.

1 free 1Z0-811 practice question on Basic Java Elements

Working with Java Data Types

What this topic covers

Declare and initialize variables, including final variables and Strings. Choose appropriate types and convert values between them, using automatic widening or explicit casts where needed.

What happens when you assign an int variable to a double variable?

The conversion happens automatically through widening primitive conversion, so no cast is needed. The numeric value is preserved, and the original int variable stays unchanged. For example, double d = count. Works when count is an int.

1 free 1Z0-811 practice question on Working with Java Data Types

Working with Java Operator

What this topic covers

Use arithmetic, relational, assignment, increment, and conditional operators to work with values and test conditions. Apply precedence and parentheses, and convert a numerator when integer division would give the wrong result.

Why does 7 / 2 give 3 but 7.0 / 2 gives 3.5?

Dividing two int values uses integer division, which discards the fraction. If either operand is a double, Java uses floating-point division. To get 3.5 from an int numerator, convert it first, such as (double) 7 / 2.

1 free 1Z0-811 practice question on Working with Java Operator

Working with the String Class

What this topic covers

Call String methods to work with text and format output. Use escape sequences and format specifiers such as %s, %d, and %n for strings, numbers, and line breaks.

Which String method returns the number of characters in a string?

The length method returns the number of characters in a String, counting spaces too. For example, "Java" has length 4. Note that length is a method with parentheses, unlike the length field of an array.

1 free 1Z0-811 practice question on Working with the String Class

Working with the Random and Math Classes

What this topic covers

Use methods from Random to generate values within a chosen range, accounting for the range returned by nextInt. Apply Math methods for common numeric calculations.

How do you get a random integer from 1 through 20 using Random?

Call nextInt(20) on a Random object and add 1 to the result. The nextInt(20) call returns values from 0 through 19, so adding one gives each integer from 1 through 20 with equal probability.

1 free 1Z0-811 practice question on Working with the Random and Math Classes

Using Decision Statements

What this topic covers

Choose program paths with if-then, if-then-else, and switch statements. Distinguish primitive value comparison from object identity, and compare String contents with equals or compare them with compareTo.

Does == or equals decide whether two Strings hold the same text?

The equals method compares the characters inside two String objects, so it is the right choice for text. The == operator compares references, so two different String objects with the same content can give false. Use equals for content and compareTo for ordering.

1 free 1Z0-811 practice question on Using Decision Statements

Using Looping Statements

What this topic covers

Repeat work with for, enhanced for, while, and do-while loops, choosing based on how iteration proceeds. Use break and continue to control loop flow, including do-while’s first execution before its condition is checked.

When should I pick a do-while loop instead of a while loop?

Pick do-while when the body must run at least once, because it checks the condition after the body. A while loop checks first, so its body may never run. For example, a do-while can read one sample before testing whether to read another.

1 free 1Z0-811 practice question on Using Looping Statements

Debugging and Exception Handling

What this topic covers

Recognize syntax and logic errors and handle runtime exceptions with try and catch. Identify common cases such as invalid integer parsing and division by zero.

Which exception does Integer.parseInt throw for text like abc?

Integer.parseInt throws NumberFormatException when the text is not a valid integer, such as abc or 12.5. Integer division by zero throws ArithmeticException instead. Wrap the call in a try block and catch the exception to handle bad input.

1 free 1Z0-811 practice question on Debugging and Exception Handling

Arrays and ArrayLists

What this topic covers

Create and use one-dimensional arrays and ArrayLists, and understand how their behavior differs. Traverse an ArrayList with iterators or loops, including enhanced for when processing items without index handling.

1 free 1Z0-811 practice question on Arrays and ArrayLists

Classes and Constructors

What this topic covers

Create classes with a main method, private fields, and appropriate constructors. Distinguish class, instance, and local variables, modify object fields, and overload constructors to support different parameter lists.

1 free 1Z0-811 practice question on Classes and Constructors

Java Methods

What this topic covers

Define and call methods, including overloaded methods and static methods. Use accessor and mutator methods to work with object state while private instance fields keep each object’s data separate.

1 free 1Z0-811 practice question on Java Methods

Related Oracle Exams

Continue to Free 1Z0-811 Exam Questions