1Z0-831 OCP Java 25 Certification Exam Objectives / Syllabus

Java Certification 1Z0-831 Exam Objectives / Syllabus

Review exam topics/syllabus for OCP Java 25 1Z0-831 Certification Exam


Java 25 is now the latest LTS version of Java. It was released in September 2025. Usually, oracle releases the certification exam corresponding to the latest LTS version within 6 months to 1 year of the LTS release date. As of November 2025, Oracle hasn't made any announcement regarding the new OCP 25 Java certification exam. Between Java 21 and 25, several features have been added to Java. Based on our experience, the following features are relevant for the new certification exam and may be covered in the upcoming OCP Java 25 certification exam:




New features that can be expected in OCP Java 25 certification exam :
  • Unnamed Variables & Patterns - Finalized in Java 22
  • New methods in java.io.Console class to format messages based on a given Locale - Added in Java 23
  • A new method Instant.until(Instant) has been added to the java.time.Instant class to obtain the Duration until the specified Instant - Added in Java 23
  • Synchronize Virtual Threads without Pinning - Added in Java 24
  • Stream Gatherers - Enhance the Stream API to support custom intermediate operations - Added in Java 24
  • New method in java.io.Reader - Reader.of(CharSequence) Method - Added in Java 24
  • New way to import all exported packages from a module - Added in Java 25
  • Compact Source Files and Instance Main Methods - Added in Java 25
  • Read from / print to std in/std out using java.lang.IO class - Added in Java 25
  • Flexible Constructor Bodies to allow statements to appear before an explicit constructor invocation - Added in Java 25
  • Scoped values - enable a method to share immutable data both with its callees within a thread, and with child threads - Added in Java 25
  • New getChars(int, int, char[], int) Method in CharSequence and CharBuffer - Added in Java 25
  • Updates to ForkJoinPool - implements ScheduledExecutorService and has a new method submitWithTimeout - Added in Java 25
  • Updates to CompletableFuture - Added in Java 25

The following objectives are for OCP Java 21. We will update these objectives as and when Oracle releases OCP Java 25 exam objectives -

Handling Date, Time, Text, Numeric and Boolean Values        

  • Use primitives and wrapper classes. Evaluate arithmetic and boolean expressions, using the Math API and by applying precedence rules, type conversions, and casting.
  • Manipulate text, including text blocks, using String and StringBuilder classes.
  • Manipulate date, time, duration, period, instant and time-zone objects including daylight saving time using Date-Time API.

Controlling Program Flow        

  • Create program flow control constructs including if/else, switch statements and expressions, loops, and break and continue statements.

Using Object-Oriented Concepts in Java        

  • Declare and instantiate Java objects including nested class objects, and explain the object life-cycle including creation, reassigning references, and garbage collection.
  • Create classes and records, and define and use instance and static fields and methods, constructors, and instance and static initializers.
  • Implement overloaded methods, including var-arg methods.
  • Understand variable scopes, apply encapsulation, and create immutable objects. Use local variable type inference.
  • Implement inheritance, including abstract and sealed types as well as record classes. Override methods, including that of the Object class. Implement polymorphism and differentiate between object type and reference type. Perform reference type casting, identify object types using the instanceof operator, and pattern matching with the instanceof operator and the switch construct.
  • Create and use interfaces, identify functional interfaces, and utilize private, static, and default interface methods.
  • Create and use enum types with fields, methods, and constructors.

Handling Exceptions        

  • Handle exceptions using try/catch/finally, try-with-resources, and multi-catch blocks, including custom exceptions.

Working with Arrays and Collections        

  • Create arrays, List, Set, Map and Deque collections, and add, remove, update, retrieve and sort their elements.

Working with Streams and Lambda expressions        

  • Use Java object and primitive Streams, including lambda expressions implementing functional interfaces, to create, filter, transform, process, and sort data.
  • Perform decomposition, concatenation, and reduction, and grouping and partitioning on sequential and parallel streams.

Packaging and Deploying Java Code         

  • Define modules and expose module content, including that by reflection, and declare module dependencies, define services, providers, and consumers.
  • Compile Java code, create modular and non-modular jars, runtime images, and implement migration to modules using unnamed and automatic modules.

Managing Concurrent Code Execution        

  • Create both platform and virtual threads. Use both Runnable and Callable objects, manage the thread lifecycle, and use different Executor services and concurrent API to run tasks.
  • Develop thread-safe code, using locking mechanisms and concurrent API.
  • Process Java collections concurrently and utilize parallel streams.

Using Java I/O API        

  • Read and write console and file data using I/O streams.
  • Serialize and de-serialize Java objects.
  • Construct, traverse, create, read, and write Path objects and their properties using the java.nio.file API.

Implementing Localization        

  • Implement localization using locales and resource bundles. Parse and format messages, dates, times, and numbers, including currency and percentage values.

Remember that Oracle may tweak the objectives any time. You may check the latest list of objectives here.

Key to Generics


Note: This article assumes that you are clear about the is-a concept in OO. i.e. A subclass object is-a superclass. For example, an Integer is-a Number (because Integer extends Number). Thus, every Integer is-a Number but every Number is not necessarily an Integer. It could be a Double or Long (or any other Number) also.

Understanding Generics is quite simple, if you understand the following three basic principles:

1. Type Safety: The main purpose of having generics is to avoid putting random things in any collection. After all, you want things organized. You don't want to put apples in a sack of potatos. And when you are given a sack of apples, you expect apples to come out and not potatos. At the same time, if you are given a "basket of fruit" as a gift, you should be able to put an orange, an apple, a mcintosh apple, or any other fruit into it. Right? And when you pick a fruit from that basket, do you always expect to get an apple? No, right? In technical jargon, this is called "type safety".

That's the fundamental thing behind Generics and is the hardest to absorb, so, read it again and again until you remember it by heart before proceeding further.

Now, the simpler stuff:

2. ? extends Apple : This means "of a class that extends Apple". Therefore, List<? extends Apple> means a sack of some variety of Apple. Mcintosh? Probably. But you don't know. In other words, "? extends Apple" does not mean "any class that extends Apple". It means a specific but unknown class that extends Apple.

Q. So, when you are given a sack of "? extends Apple", can you put a Mcintosh in it? If you have any doubt, read point 1 again.
(Hint: Do you want to mess up your sack of Fuji apples by putting a Mcintosh apple in it?)
Q. So, when you take out a thing from a sack of "? extends Apple", what do you get?
(Hint: An Apple for sure. But are you sure you will get a Fuji Apple? You don't mind if it is a Mcintosh or a Fuji, do you? As long as you don't get a Potato, you are good.)

3. ? super Apple: This means "of a class that is a super class of Apple". Therefore, List<? extends Apple> means a sack of something of which an Apple is a kind. Let's call it "it". So, What do you call a sack of something of which an Apple is a kind? A sack of fruits. Are you sure? Can you not call it a sack of food items? Can you call it a sack of Mcintoshes?
(Hint: Every apple is a kind of fruit. Every apple is a kind of food item. Is every apple a kind of Mcintosh?) So, given listOfSuperApple, which is declared as List<? super Apple>, which of these statements should work?

listOfSuperApple.add(anApple);
listOfSuperApple.add(someFruit);
listOfSuperApple.add(aMacintoshApple);

Read 1 again, if in doubt.

Q. So, when you take out stuff from a sack of "? super Apple", what do you get? Apple? Probably. A fruit? probably. Some food item? probably. Are you sure? No. So what are you sure of? Well, its something, but you don't know what. So, you are sure of nothing, really. Which of these statements should work then?

Apple a = listOfsuperApple.get(0);
Fruit a = listOfsuperApple.get(0);
FoodItem a = listOfsuperApple.get(0);
Object a = listOfsuperApple.get(0);

Read 1 again, if in doubt.

Q. So, when you are given a sack of "it", can you put any apple in it? Well, can you not put any apple in a sack of fruits? in a sack of food items? In a sack of apples?

Read 1 again, if in doubt.

That's it! If you understand point 1, you will never miss any question on generics. Ever!

Quiz: What would List<?> mean? What can you put in it and what can you take out from it?

Note: The answers to the above short questions are not given to encourage you to write small test programs and confirm your understanding.

OCAJP 8 Java Certification Fundamentals eBook

If you are preparing for OCA Java 8 Certification 1Z0-808 exam, we highly recommend the following study guide by Hanumant Deshmukh:



Written by an expert with more than 20 yrs of professional Java experience, this book explains important concepts from a beginners' point of view. It also identifies pitfalls and gotchas that you will encounter in the real exam.

The biggest advantage of this book is that it after covering required theory, it presents you with simple coding exercises that you can do to consolidate your understanding of the concepts.

After you finish doing to the end-of-chapter exercises of this book, you will notice a gain in your confidence level and your score on mock tests will shoot up.

How to write Lambda expressions for functional interfaces

A lambda expression is basically implementation of a method written in shorthand. To begin with, assume that you have the following class and a method that uses java.util.function.Predicate
public class Data{
    int value;
    Data(int value){
        this.value = value;
    }
}

public void printUsefulData(ArrayList dataList, Predicate p){
   for(Data d: dataList){
        if(p.test(d)) System.out.println(d.value);
   }
}
Before Java 8, you would have to create a class that implements Predicate interface and pass an instance of that class to the printUsefulData method. Something like this -
printUsefulData(al,  new Predicate(){ 
                            public boolean test(Data d){ 
                                 return d.value>1; 
                             }   }   );
You can see that the above construct allows you to customize the logic of Predicate's test method anywhere you want to call printUsefulData method. The whole point of writing lambda expressions is to let you do the same thing but without typing too much code. So all you are doing with lambda expressions is removing the bits and pieces of the code that are redundant. Afterall, why type stuff that the compiler can figure out on its own, right?

If you look at the code above, you can see that "new Predicate()" part is actually redundant. The compiler already knows that Predicate is an interface and we can only pass an instance of some class that implements this interface. It also knows that this interface has only one method. That means, the only unknown information that we are giving to the compiler is the method implementation. The compiler can easily wrap up the method code into an anonymous class on its own.
Now, lets take a look at the test method that we wrote above -
public boolean test(Data d){
    return d.value>2;
}
The important elements of the above code are - return type, method name, parameter list, and the method body. When you write a lambda expression, you are essentially providing an implementation of the same method. Therefore, the lambda expression code that you need to write must contain all the pieces of the above code except the ones that the compiler can figure out on its own. For a functional interface such as Predicate, the compiler already knows the name of the method that you are going to implement because there is only one abstract method in the interface. This fact drives the basic syntax of a lambda expression -
(parameter list) -> { method body }
That's it. This is all that you need to provide to the compiler and it can create the whole implementation of the interface on its own. Notice that there is no method name here. Thus, a valid call using a lambda expression would be -
printUsefulData(al,  (Data d) -> { return d.value>2; } );
But there is even more that a compiler can figure out on its own. It also knows the parameter types of the method. Thus, you can also write -
printUsefulData(al,  (d) -> { return d.value>2; });
If your method body just returns the value of an expression, the compiler can put the return keyword on its own. Thus, you can also write -
printUsefulData(al, (d) -> d.value>2);
Notice that the curly braces, return keyword, and the semi-colon at the end of the expression are gone. If there is only one parameter, there is no need for ( ) in the parameter list either. Thus, you can write -
printUsefulData(al, d->d.value>2);
Let us see some examples of invalid lambda expressions -

printUsefulData(al, d->return d.value>2); INVALID - If you write return, the compiler assumes that you are writing the complete method body and so it expects curly braces and the semi-colon i.e. printUsefulData(al, d-> {return d.value>2;}).

printUsefulData(al, Data d->d.value>2); INVALID - If you write parameter type, the compiler assumes that you are writing the complete parameter list of the method and so it expects the brackets i.e. printUsefulData(al, (Data d) -> d.value>2);.

Lambda expressions for an interface with a method that takes multiple parameters can be written like this: someMethod(al, (Type1 a, Type2 b) -> methodbody ); For example, if you have,
interface I1{
  void m1(int a, int b);
}
and
public static void someMethod(ArrayList dataList, I1 p){
   for(Data d: dataList){
        p.m1(d.value, d.value);
   }
}    
You can call it like this - someMethod(al, (x, y) -> System.out.println(x*y));
But someMethod(al, x, y ->d.value>2); is INVALID because if you have multiple parameters, the compiler cannot associate the -> sign with both the parameters without brackets. You should now write some simple interfaces and methods and call them using lambda expressions. Try out various combinations to see what works and what doesn't. For the purpose of OCA-JP8 exam, this article is enough but you can go through Oracle's official tutorial on Lambda expressions to learn more.

How to study for Java Certification OCAJP 8 exam?

how to improve low scores on OCA OCP Java mock exam

Oracle's Java 8 Professional Programmer certification has been split into two exams - Associate level and Professional level. To be Oracle Certified Java 8 Professional, you need to first clear the Associate level exam (known as OCAJP) and then the Professional Level exam (known as OCPJP). If you already have Java Professional Programmer certification for Java version 6 or 7, you can take an upgrade exam to acquire the OCP Java 11 certification but there is no upgrade path to OCP Java 8 anymore.

OCAJP and OCPJP exams are important because one needs to be an Oracle Certified Professional Java Programmer to be eligible for becoming Oracle Certified Expert on various Java technologies such as Servlet/JSP, JPA, EJB, and Web Services.

There used to be an entry level exam called the Sun Certified Java Associate (SCJA), which has been replaced with Java Foundations Certified Junior Associate exam. This exam is for school and college students, who have just started to learn Java. This exam does not make you eligible for any other exam and so is not as critical as the OCAJP exam.

How to use books and mock exams for OCA Java 8 1Z0-808 exam?

It is important to buy a good book for studying the exam topics before you choose to purchase any good mock exam simulators such as Enthuware. There are several books for this exam and we will list them all below. However, the one by Hanumant Deshmukh titled OCAJP Associate Java 8 Programmer Certification Fundamentals: 1Z0-808 is particularly good because it focuses on clearing a lot of misunderstandings related to Java basics. Other books tend to skimp on the basics.

There are also many free resources and articles available for this exam. They are listed here.

The actual exam is tough and also expensive. Therefore, it is important to be sure that you are well prepared for the exam so as to pass in the first try. Use mock exams in your last leg of preparation to ensure there are no gaps in your preparation. Our mock exams are closest to the real exam and cover each an every aspect of the topics and also make you aware of all kinds of trick questions that you may get on the exam.

Our Question Banks contain questions organized as Standard Tests. These tests mimic the real test in terms of content and toughness. If you have experience with the technology, you may start directly with these tests. Otherwise, you should first study all the exam objectives from a book. You should also write lot of test programs to solidify your understanding of various concepts.

Once you are comfortable with all the topics from the book, you should start with the first Standard Test. Your score on this test will tell you how well you are prepared for the actual test. You should make a note of all the topics on which you score less and study them from a book. After going through the book, review all the questions of the test one by one and read the explanation for each question, including the questions that you answered correctly, and then attempt the next Standard Test.

Our explanations are really thorough. You should not be surprised to find them more informative than even some books. So please make sure you go through all of them.

Important - If you fail a Standard Test, you should NEVER attempt the next Standard Test before going through a book and learning about the topics on which you scored less. If you move to the next test before doing that, then you will not be able to perform well on the real test.


Taking the same test twice:

You should never take the same Standard Test twice. This is because you will inadvertently remember the answers and you will invariably score a lot higher on this attempt. This creates a false sense of confidence, which will cause you a problem in the real test. Remember, your objective is to improve your score on the subsequent tests not on the same test.

Here are the books for OCAJP 8 exam:

Good Books for Java Certification Exam OCAJP 1Z0-808