Travel to Java Planet. My experience of Java 11 Developer certification (Part 2)

Travel to Java Planet. My experience of Java 11 Developer certification (Part 2)

My name is Yevgeniy Berezhnoy. I’m a Java Developer at AB Soft. This article will focus on the second exam on Java 11 Programmer II (1Z0-816). Read  Part 1 to learn more about the first exam and Professional: Java 11 Developer certification. The second exam differs significantly from the first one, but here comes some good news: it's different in a good way.

First, the exterminators no longer try to catch you at the lack of focus. You either know how the code works, or you don't.

Second, the exam is way more extensive and complex. You will gain much more instrumental knowledge while preparing for it.

Disclaimer: I don't work at a certification center or promote certification or get a kickback for it. I will just share my experience. So, reader discretion is advised.

Illustrations: Dmitry Yatsenko

Certification comprises two exams. I recommend taking Java 11 Programmer I (1Z0-815) first and then moving to Java 11 Programmer II (1Z0-816). However, it's not a requirement, and you can opt for a different order.

If you are titled OCP 6...8, you have to pass only one exam — Upgrade OCP Java 6, 7 & 8 to Java SE 11 Developer 1Z0-817, which is very similar to Java 11 Programmer II (1Z0-816) in terms of topics covered, so this information will also be instrumental for you.

By the way, our Belarusian colleague published a very decent Study Guide on this exam.

If you hold an OCA 7, 8 title, you don't need to take Java 11 Programmer I (1Z0-815) and can conquer Java 11 Programmer II (1Z0-816) at once.

Good news: you are entitled to resit each exam for free (once). Read more about it here.

Examination topics

Java 11 Programmer II (1Z0-816) is based on the old OCP 8 (1Z0-809) exam. The list of the topics and a comparison chart are presented here.

For preparations, I recommend the book «OCP: Oracle Certified Professional Java SE 8 Programmer II Study Guide: Exam 1Z0-809» by Boyarksy/Selikoff or «OCP Java SE 8 Programmer II Exam Guide (Exam 1Z0-809)» by Sierra/Bates, that outline in details the topics that migrated from OCP 8. This article will focus on the Java 9...11 novelties and issues not included in the exam before.

Please, note that some topics from the study guides are not covered in the exam, but they will still be helpful in your everyday work. For instance, there are no exam questions on Fork/Join Framework and project patterns.

Well, let’s start our novelties review.

Modularity

Modules are our everything! Divide et impera! Oracle actively uses this idea to promote this novelty. There are going to be about a dozen questions about modules. And unlike in Part 1, they will be of practical nature.

You will be asked whether module-info.java is written correctly, including the correct application of Service Provider Interface (SPI), which gets a second wind with modularity. They will ask whether imports and exports are done correctly and whether compilation and execution require at least one service provider. There will be many more questions that you can only answer by practicing.

So, I suggest exploiting Schildt’s book Edition 10 and later, which offers extensive explanations (a total of 25 pages or so). Once you practice them, you will have the answers to 90% of modularity questions. But you need to soak yourself into the subject, not just thumb through a book quickly.

If you decide to take a deep dive into modularity, my recommendation is «Java 9 Modularity Book». It offers an excellent example of migration's practical use and strategy.

I only had one question on jdeps at my exam - it is quite an excellent tool to spot compilation dependencies. At least, get an idea of it.

There were no jmod and jlink questions on my exam.

Serialization and security

A new and broad theme at the exam is, of course, security. Serialization is a big security loophole, so you have to study all those topics together. There will be about 10 questions on the matter - quite a few. And they are most challenging to prepare for, I'd say. The questions vary from purely theoretical to those of this type:

●     What are you expected to do for the code to be seen as secure?

●     When are you expected to make an object's deep copy for mutable classes?

●     How are you expected to make a copy constructor?

Besides the dull must-reads, such as "Secure Coding Guidelines" and Chapters 1, 2, and 3 of "Serialization Specification," spare time for Bloch’s «Effective Java» I love so much. It has a chapter on serialization that also looks at security issues.

Annotations

An annotation is one of the old Java options included in the exam before, but modern development is unimaginable without it. The exam will challenge your knowledge on @Repeatable and built-in basic annotations, such as  @SuppressWarnings and @SafeVarargs.

You must be aware of the arguments they are used with. And you’re expected to be able to write annotations yourself. To cope with these intricacies, take Schildt or an official Manual.The possibility to use reserved types of local var is yet another innovation in Java10. Starting from Java 11, one can employ it for lambda-expression parameters to use annotations for these parameters. Don't doubt that the exam will check your knowledge of these novelties.

JDBC

The JDBC section has one new topic - using CallableStatement. I didn’t come across the question on it, but all other JDBC questions were in place. The books I recommended above describe it quite well. You can read about CallableStatement and how it differs from PreparedStatement here.

Interfaces

A new issue that you should keep in mind: starting with Java9, interface methods can be private. Private methods can be static and non-static.The methods can't be both private and default at the same time. These methods are used both in default and static methods of the interface itself, so they are introduced as auxiliary ones and allow for re-use of the code shared by other methods within the interface.

These methods are subject to the rules, similar to the class private methods:

●     Private methods can’t be abstract.

●     They can be used only inside of the interface.

●     Private static methods can be used in other static and non-static interface methods.

●     Private non-static methods can't be used within static methods.

OnTopics, On topics that migrated from OCP8 and on preparations in general

Pick one of these books: Boyarksy/Selikoff or Sierra/Bates. You’d better not switch between them. Make a rule to read one chapter a week and take one mock test at the end of the chapter. As a result, after 2,5 months, you will have good knowledge of the topics migrated from OCP8 (IO, NIO 2.0, Concurrency, and others). These articles can help revise the new topics:

While reading the books, code as much as you can to get a real sense of it and understand how to apply the knowledge you've gained. The most important thing is to know why it works in this exact way.

You should have a solid understanding of inner classes, initializing them, and what parent class elements they have access to.

Pay special attention to Stream API and lambdas. You’ll have a whole lot of it at the exam. Learn the basic functional interfaces' methods, arguments, and return values (Consumer, Supplier, Function, Predicate, UnaryOperator) by heart. And make sure you understand how derived interfaces are produced. You should also be able to write your functional interface yourself.

At the exam, I came across a fascinating and unusual code; I suggest you finding out the result of its execution:

public class TestClass{ public static int operate(IntUnaryOperator iuo){ return iuo.applyAsInt(5); } public static void main(String[] args) { IntFunction fo = a->b->a-b; int x = operate(fo.apply(20)); //2 System.out.println(x); } }

The first eye-catching and intimidating thing is the expression a->b->a-b; but the puzzlement steps away if you re-write the fragment as a->(b->a-b).

IntFunction is a functional interface that receives int and returns something it was typed for. In this case, it is converted to IntUnaryOperator. Therefore, IntFunction<IntUnaryOperator> receives int and returns IntUnaryOperator.

If you have a look at fo = a->b->a-b now, you will see that a is the argument of int type (as it is used to receive IntFunction), while b->a-b forms the method body of this IntFunction, which will return IntUnaryOperator.

IntUnaryOperator is the functional interface that receives int and returns the other int. It can't be typed as anything else as both the arguments and return value are already assigned as int.

It means when you call fo.apply(20), you set a=20. From that point, b->a-b returns as IntUnaryFunction iuo equaling b->20-b

Then you call iuo.applyAsInt(5), where b value is set at 5. So, 20-5 makes 15 - this is our result.

Streams also have many bulky constructions. Get a clear view of how to use grouping and particioningBy, merge methods. Practice and figure out how to use the method links.

You will also have to check out the new factory static methods for the collections, provided by Java9. You can find the information on them, as well as the examples here.

If you

still doubt your skills after following all the recommendations, try mock tests at Enthuware and search through the certification forum on CodeRanch.

Summary

As I have mentioned before, the exam lasts 3 hours. This time is enough to answer all 80 questions. The passing score is 63%.

You will have the results in your email only 15 minutes later.If you passed the exam successfully (and you will if you prepared well), in 48 hours, you can download the OracleCertView certificate and receive a blockchain-verified electronic badge (surprisingly, they haven’t engaged AI here yet).

Electronic badge

You can also request a hard copy they send you by mail 2-3 weeks later. I decided against ruining yet another tree. The modern world could use some green.

It is what the certificate looks like.

You also get an opportunity to buy merch, but the delivery cost makes the items too overpriced.

Overall, the most valuable thing the certification gives you is knowledge. Nobody can take them away from you, except perhaps Men in Black.

The exam is not complicated; you just need to prepare. And, of course, as Obi-Wan Kenobi bequeathed, never stop practicing, and you shall succeed.

May the force be with you! Good luck!