OCP Java 21 Certification 1Z0-830 Exam Experience

Java Certification 1Z0-830 Exam ExperienceTwo of our content developers took the new OCP Java SE 21 Developer Certification exam (Exam Code 1Z0-839) a couple of weeks ago and here is what they had to say about the exam.



The number of questions in the 1Z0-830 exam is 50, which is the same as the older OCP Java 17 exam but the new exam gives you 120 minutes instead of 90 minutes. Now, it may seem like an extra 30 minutes has made the exam easier but some of the questions on this exam are framed in a style that is quite different from the older exam, and the extra time is definitely required to answer such questions. More about that later. First the basics.

Just like the OCP 17 exam, the the exam objectives for OCP 21 cover a lot of topics. They range from basic, such as variable decarations, classes, loops, conditionals, overloading, and overriding) to really advanced, such as concurrency, streams, Date API, and NIO. Notably though, JDBC has been removed from OCP Java 21. Such a wide range of topics means that you may not get a question on all the topic in the exam. But believe it or not, this is a very good thing. In the past, it was easy to cheat on the exam by using exam dumps (which is just a euphemism for real exam questions). This reduced the integrity of the exam and reduced the value of the certification for those who study using genuine study material. But now, it will now be very difficult to pass the exam just by studying dumps. No two candidates will get the same questions. So, even if one studies from exam dumps, they may get a totally different set of questions.

Our content experts got questions on the following topics, and as explained above, since the number of questions were so less (only 50), some topics were completely left out. Of course, this doesn't mean that the exam doesn't have questions on these topics. Another candidate may get a different set of questions, which may include questions on these topics.


Feedback on the content of OCP Java 21 Certification Exam

  1. Java Language updates:
    • Basic questions on records and sealed classes.
    • Questions on instanceof and switch with pattern matching. Must know "flow scope" as well as record deconstruction.
    • Some questions used the new multiline strings (text blocks) in their problem statement, but only a couple of questions were specifically about this feature.
    • Some questions used the new switch expressions even though the question was not really about case expression as such.
    • Theoretical questions on Virtual threads, thread states, and locks.
    • No question on less commonly used interfaces/methods of the Collection API such as Spliterator.
    • No question requiring knowledge of classes in the atomic package (such as AtomicInteger)
  2. Localization: Questions on various API methods such as NumberFormat.getCurrencyInstance.
  3. Modules:
    1. A few questions on Modules including advanced topics such as services including questions on command line options such as -classpath and --module-path.
    2. Surprisingly, we got questions on JImage.
  4. Questions requiring thorough knowledge of the java.time package (the new Date API), including time zones and Daylight savings time.
  5. Multithreading/Locking:
    1. Question on Lock, ReadWriteLock, ReentrantReadWriteLock, and its methods (tryLock(), lock(), and unlock())
    2. No question on ExecutorService as such but program statement makes use of various implementations.
    3. Must know about ThreadLocalRandom!
    4. There were a few questions that required a thorough understanding of thread states and wait and notify.
  6. File I/O:
    1. Questions requiring thorough knowledge of Files and Path classes.
    2. For some reason, exam designers are crazy about serialization because the exam had really tough questions on this topic. One of the questions even expected the candidate to know a bit about customizing serialization by implementing readObject/writeObject methods.
  7. Arrays/Collection/Stream: Several questions
  8. Overloading: Complicated questions on method resolution when using ambiguous arguments involving int/float/long/double.
  9. Advanced questions on Enum. Must know about methods such as valueOf() and ordinal().
  10. Moderately tough questions on exceptions.
  11. No question requiring knowledge of Annotations, Logging, or Math.random().
  12. A few moderately tough questions on streams.
  13. Many questions had errors - grammatical as well as technical.

General Feedback about the OCP Java 21 Certification Exam

  • Most questions have 5 to 6 options but some of them had 7 or 8 options as well. 

  • Unlike OCP 17, this new OCP 21 exam has many questions that are very lengthy to read. This is because some questions (definitely not all) were styled differently. Instead of asking, "what will be the output of the following code", they asked, "Which of the following code snippets will produce this output?". This style of questioning puts multiple code fragments in options and that makes the question really lengthy to answer. You really need to act smart by eliminating obviously wrong options to arrive at the right answer for such questions. Some questions had long code in the problem statement as well. Which is why the extra 30 minutes is not really a favor.
    Another thing that makes this exam tougher than the previous version is that many questions required thorough knowledge of multiple topics. There weren't many such questions on OCP Java 17.

  • Time is NOT enough even if you know the material well. Besides memorizing a lot to stuff, you must practice solving questions thoroughly if you want to pass this exam.
Overall, the test was very hard (harder than OCP 17) in terms of breadth of topics and depth of understanding required. You can't just read a topic cursorily and expect to answer exam questions on it. For example, the questions on enums required that you know the complete ins and outs of how they work. The exam also requires a lot of memorization. Questions on Date, Localization, I/O, threading, and the Collections/Stream API require you to know a wide range of methods that are provided by the Java library.
Conclusion
We have observed that Oracle starts administering the exam with low quality questions because OCP 17 also had the same issues initially (ambiguous questions, mistakes, long code snippets, 8+ options). Oracle then updates the questions based on the candidates feedback and/or performance. So, if you can, just avoid taking this exam just yet. Wait for a few months to let it stabilize. If you are in a hurry to get certified, take OCP 17.

How to prepare for 1Z0-830 exam

  1. Books: Fortunately, OCP Java 21 Exam Fundamentals book, written by Hanumant Deshmukh has been released. It covers all of the topics required for this exam.
  2. Mock Exams: Our mock exams for OCP Java 21 are also available now.

1Z0-830 OCP Java 21 Certification Exam Objectives / Syllabus

Java Certification 1Z0-830 Exam Objectives / Syllabus

Review exam topics/syllabus for OCP Java 21 1Z0-830 Certification Exam (As of 2024/07/07)


Oracle has announced the exam objectives/syllabus for the Java 21 Professional Programmer certification on 06th July 2024. These are as follows:




Highlights and differences between 1z0-829 and 1Z0-830:
  • Virtual Threads has been added in OCP 21
  • Pattern matching with instanceof and switch, record deconstruction have been added in OCP 21
  • JDBC has been removed from OCP 21
  • Serialization, Modules, Date API, Localization, I/O still exist.

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.

Java 17 and 21 Switch statement and expression summary

Switch Statement (w/o pattern matching) Summary


Old Syntax ( : ) New Syntax( -> )
  Allows zero or more individual statements or zero or more code blocks.
Examples (all valid):
case 0:
case 1: stmt1; stmt2;
case 2: { <code block1>} { <code block 2> }
Allows either exactly one statement or exactly one code block.
Examples (all invalid):
case 0 -> //invalid, empty case
case 2 -> stmt1; stmt2; //invalid, more than one statement
case 4 -> { } { }//invalid, more than one block

Selector expression type Limited to: byte, short, int, char, and long and their wrappers, String, and enums
Not Allowed: boolean, float, and double
Limited to: byte, short, int, char, and long and their wrappers, String, and enums
Not Allowed: boolean, float, and double
Case label constant type Must be compatible with selector expression type. null is allowed in Java 21 but only if the switch is exhaustive. Must be compatible with selector expression type. null is allowed in Java 21 but only if the switch is exhaustive.
case label

Allows a single case constant. Allows multiple case constants separated by comma. Example:
case 1, 2 -> { }
default label  Not required Not required
Order of switch labels No restriction No restriction
 break Needed only to prevent fall through
Prohibited when a switch label is associated with a single statement.

Allowed within the code block  associated with a switch label but is redundant.
 yield Not allowed
Not allowed
 exhaustive Not neccessary  Not neccessary 



Switch Expression (w/o pattern matching) Summary


Old Syntax ( : ) New Syntax( -> )
  Allows one expression or one code block.
Examples:
case 0: yield 1; //valid, returns 1
case 3: yield "aa".length(); //valid, returns 2. case 2: "a".length(); //syntactically valid, no yield required for non-void method call but falls through without returning a value

case 1: 1; //invalid, missing yield keyword
Allows one expression or one code block.
Examples:
case 1 -> 1; //valid, returns 1, no yield required
case 3 -> "a".length();//valid, returns 1, no yield required
case 4 -> { yield 1; }//valid, yield is required in a block

case 0 -> //invalid, missing expression
case 2 -> yield 1; //invalid, must not write yield
Selector expression type Limited to: byte, short, int, char, and long and their wrappers, String, and enums
Not Allowed: boolean, float, and double
Limited to: byte, short, int, char, and long and their wrappers, String, and enums
Not Allowed: boolean, float, and double
Case label constant type Must be compatible with selector expression type. null is allowed in Java 21 but only if the switch is exhaustive. Must be compatible with selector expression type. null is allowed in Java 21 but only if the switch is exhaustive.
case label

Allows a single case constant. Allows multiple case constants separated by comma.
Example: case 1, 2 -> 1;
default label  Not required if already exhaustive Not required if already exhaustive
Order of switch labels No restriction No restriction
 break Prohibited Prohibited
 yield Required to return value
Required only when returning a value from a code block. Otherwise prohibited.
 exhaustive Neccessary  Neccessary 


Switch Statements and Expressions (w pattern matching) Summary (Java 21 Only)


Old Syntax ( : ) New Syntax( -> )
Selector expression type All types are allowed All types are allowed
Type of case constants Must be compatible with the type of the selector expression Must be compatible with the type of the selector expression
 exhaustive Necessary Necessary
default label 

Not required if already exhaustive
Not required if already exhaustive
Order of switch labels
Must follow the rule of dominance Must follow the rule of dominance
Fall through behavior Not allowed. So, break is required after each switch label. Fall through is not possible. break is prohibited.

Time required to pass OCP Java 17 exam

Time to prepare for OCP Java certification exam Determining the time required for passing the OCP Java 17 exam is highly dependent upon your current experience and expertise. The following estimates are based on our experience.

If you are:
  1. New to programming: 1+ Year 
  2. An expert in another language such as Python or JavaScript: 6+ months 
  3. Experienced in Java and have been programming in Java professionally for about an year: 3+ months 
  4. Already OCA 8 certified recently: 3+ months
  5. Already OCP 8 or OCP 11 certified recently: 1+ months 
This assumes about 3 hours of study per day. Study incudes reading book(s), writing test programs, and attempting mock exams. 

To get a better estimation for yourself, we suggest you to take a mock exam and see how you score. If you are able to pass the mock exam, you can go through the rest of the mock exams one by one (one per day), go through all the explanations after each mock exam. 

If you fail the mock exam but score above 50%, you may require about 1 month of effort to raise your score by 10 points. You will need to go through the topics on which you scored less from a book and write test programs before taking the next mock exams.

If you score too low, then you should to take a month or two to go through a book first and then come back to the mock exams.

Ideally, your score should increase with each mock exam and you can consider yourself ready if you are able to score about 75%.

But again, the above are just estimates based on our experience in training students. Only you know how you study and how fast you can learn new concepts. 

All the best!

OCP Java SE 17 Developer (Exam 1Z0-829) Programmer's Guide by Khalid Mughal and Vasily Strelnikov - Book Review by Hanumant Deshmukh

OCP Java SE 17 Developer (Exam 1Z0-829) Programmer's Guide by Khalid Mughal and Vasily Strelnikov - Book Review by Hanumant Deshmukh
We, at Enthuware, are always on the lookout for good study material for various Java Certification exams. We were elated when we learnt about the new book on OCP Java 17 certification (Exam Code 1z0-817) exam written by Khalid Mughal and Vasily Strelnikov. Mr Mughal needs no introduction, as he has been a Java expert at least since I started programming in Java. I passed my first Java certification more than 20 years ago (it was called SCJP 1.2 back then) using his book. There were multiple certification books at that time, and his book stood out due to the quality of its contents in terms of coverage, depth, and technical precision.

In the present day, the latest professional level Java Certification is the OCP Java 17 certification, and a there is only one book on the market for this exam as of now (March 2023). A second book by a seasoned expert such as Mr. Mughal is greatly appreciated.

Last week I received a copy of the new book for review, and here are my thoughts about it:

  1. The book is huge at 1800 pages and comes in two volumes. I can easily see why that is. First, the exam covers a wide range of topics ranging from beginner to expert level. Any book that claims to prepare a student for this exam will be thick. Second, this book doesn't cut corners. If the authors feel something is important enough to be told and explained, then it is covered even if it is not directly mentioned in the exam. Third, the book can be used even by a Java beginner, so concepts are taught from the ground up.

  2. While going through the book, I noticed that it covered some topics such as Annotations and Security, that are not present on the OCP Java 17 exam anymore. They were there on the older Java 11 exam. I enquired about it with the authors and learned that they included these topics partly because they felt they were important and partly to make the book useful for candidates taking the OCP Java 11 (Exam Code 1Z0-819) exam.

  3. Complicated concepts such as Generics have been taught thoroughly. For example, students find it confusing that Node<Integer> and Node<Double> are not subtypes of Node<Number> even though Integer and Double are subtypes of Number. Concurrency and parallalism is another tough topic to grasp. The book explains all such topics in great detail.

  4. The chapters are peppered with objective questions, and at the end there is a full sized mock exam with detailed explanations for all of the questions.

  5. If you are short on time and want to just focus on passing the exam in the shortest time possible, then you may have to look for other resources because the book does include topics that are not required for the exam at all. For example, Appendix G on the Java Logging API can be skipped. But in all fairness, the official exam objectives do mention it in passing. We haven't prepared a complete list of such topics, but we might do that later as we start using the book in our training program.
Overall, the book is quite useful for anyone studying for this exam. I am happy to note that this book has maintained the same standard that I appreciated as a test taker twenty years ago, and if you are planning to have a career in Java programming, I wholeheartedly recommend studying for the OCP Java 17 exam using this book.

Hanumant Deshmukh
Director, Enthuware