Philippe De Neve

Greenhorn
+ Follow
since Jun 18, 2017
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
2
In last 30 days
0
Total given
0
Likes
Total received
8
Received in last 30 days
0
Total given
1
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Philippe De Neve

Hi M Janssen, well above, i.e. 82%
Hi,

I like to share my experience on preparing and taking the exam 1Z0-819 Java 11 Developer exam.

Preparation:

Book Selikof/Boyarsky java 8 oca and ocp books (I did these certifications in 2017 and 2018 resp.).
Oracle java trail Annotations
Oracle java trail Security
Oracle security guidelines: https://www.oracle.com/technetwork/java/seccodeguide-139067.html
JPMS: Sander Mak's training on Pluralsight + his book on JPMS
Did all enthuware exams 1z0-815, 1z0-816. I always made sure that I completed the exams at an average of less then 1.8 minutes per question
1z0-815 exams first round scores: 90%+, second round: 90%+
1z0-816 exams first round scores: 80%+, second round: 90%+

I prepared by means of the mentioned material because I had it ready available. However, I advice you to learn from Selikoff/Boyarsky's book on Java 11 (https://www.selikoff.net/ocp11-complete/) and do the Enthuware mock exams from the 1Z0-819 test bank and/or Boyarsky/Selikoff's practice tests (https://www.selikoff.net/ocp11-pt/) if you're starting from scratch + this extra post by Boyarsky: https://www.selikoff.net/2020/11/05/819-security/. Also look at https://www.selikoff.net/ocp11-819/ for some topics that were removed from the exam.

Biggest challenge is the limited time you get (1.5 hours for 50 questions, i.e 1.8 minutes per question). You have to know everything very well and still several questions will be too long to analyze the code thoroughly. Selikoff's post tells which strategies to apply: https://www.selikoff.net/category/java-certification/

Total preparation time: 3 months lead time of which 4 weeks of vacation which I used for the preparation. For the rest I perpared afterwork and during the weekends.
Indeed no compiler warnings are generated. If the unbounded wildcard was to be removed, these warnings would be generated.
Hi Jeanne,

Glad to help!

It's exciting to hear you're working on an OCP 11 book. Looking forward to it!

I like to make some clarifications on some points.

4) In fact, only the merge method is covered in chapter 3, not the flatMap method. Furthermore, page 171 lists the exam objectives covered in chapter 4. The last bullet on the page is saying "Use of merge() and flatMap() methods of the stream API". In chapter 4, flatMap() is covered, but not merge().

11) Saying that a key has an associated key is incorrect. A key has instead an associated value. The sentence is indeed saying "In a nutshell", but it's not justifying the statement that a key has an associated key.

15)
I'm convinced this is an errata. For all rows, except the sixth one (mapping), the third column shows the return value of the collect method when the specified Collector is passed to it. For the sixth row (mapping), the third column shows the return value of the mapping method itself, not the return value of the collect method when mapping() is passed to it.

To illustrate this better, I have written examples for the first six rows of the table:



Thanks everyone for the congrats!

@Simon, other study material I used were the answers that are provided in the Enthuware software. It's very useful to read these (and sometimes there is a bit more info, like for enums). For Java IO, I used the http://www.falkhausen.de/Java-8/ website to see the structure better of the java.io package and which methods there are per class (e.g. Writer has append methods, and consequently PrintWriter, while OutputStream does not have append methods, but PrintStream does have append methods anyway). This website is also handy for other packages.
5 years ago
Hi Ritchie, the authors of the book are Selikoff and Boyarsky.
While studying from the Oracle Certified Professional Java SE 8 Programmer II Study Guide, I took notes on some errata I came across that were not listed yet. Please find them below.

1. page xlix
Question 11: It's not clarified why option D is not correct. Option D will print 1 instead of throwing an exception, making the statement incorrect.

2. page 33
Table 1.2, row number 6, column 1 is saying "Can access local variables of enclosing class". I don't think a class can have local variables. It can have instance and class members, but not local variables. I suppose the sentence means to say "Can access local variables of enclosing method", making the answer in the second and fifth column "N/A" (Member inner classes are not contained within a method and static nested classes can not be defined within a method respectively).

3. page 42
Question 14: In the import statement, there is an extra space between "java.util." and "*"

4. page 103
The last item (Java Stream API) of the overview of OCP exam topics covered in chapter 3 (Generics and Collections) is not covered in this chapter.

5. page 113
The second item in the bullet list of the real world scenario box is saying that it is not possible to "Create an array of that static type". It is not clear to me what is referred to by "that static type". Shouldn't this be "of that generic type"?

6. page 123
Second to last paragraph: "Now on to the methods. Try to figure out why they don't compile". The first method "method1", does compile though.

7. page 136
Table 3.5, description of peek() method: "Returns next element or returns null if empty queue". Note that for Stack (peek is also for stack), an EmptyStackException is thrown if empty stack.

8. page 152
Last sentence of first paragraph: "We will show you how to use the removeIf(), forEach(), merge(), computeIfPresent(), and computeIfAbsent() mehods." The replaceAll() method is also shown in the chapter.

9. page 153
Section just after the bullet list: "In this chapter, we will be using three functional interfaces in our examples. We will use more in the next chapter. Remember from Chapter 2 that Predicate is a functional interface that takes a single parameter of any type and returns a boolean. Another functional interface is Consumer, which takes a single parameter of any type and has a void return type. Finally, Supplier doesn’t take any parameters and returns any type."
In that section, indeed Predicate, Consumer and Supplier is used, but further into the chapter there is also a UnaryOperator (in section "replacing elements") and a Function and BiFunction (in section "Map APIs").

10. page 155
First paragraph of section "Looping through a Collection": "Looping though a Collection...": there is a missing r in though.

11. page 157
Section "computeIfPresent and computeIfAbsent": computeIfPresent() calls the BiFunction if the requested key is found and the associated key not null. "associated key" should be "associated value".

12. page 158
Second paragraph: "For computeIfAbsent(), the functional interface runs only when the key isn’t present or
is null". "or is null" should be "or the value is null".

13. page 159
table 3.11: For merge, the Functional Interface used is "BiFunction (Takes existing value and new value. Returns new value)". I've found "Returns new value" a bit confusing, as it might refer to the new value that is given to the BiFunction. Maybe better would be "Returns result of BiFunction" (can be applied to the other methods (computeIfAbsent and computeIfPresent) too, to be consequent).

14. page 213
The table at the top is a continuation of table 4.10, but doesn't have the header "Table 4.10 Primitive-specific functional interfaces (continued)"

15. page 217
Table 4.11, row 6 "mapping(Function f, Collector dc)": the return type when passed to collect is the generic type R of Collector dc, not Collector.

16. page 247
The sentence just before the section "Working with Durations": "As you can see, you’ll have to pay attention to the type of date and time objects every place you see them.". I think there should be "in" between "objects" and "every place"

17. page 301
Third paragraph: "Java strongly recommends that close() not actually throw Exception". I believe "throw" should be "throws".

18. page 312
The exception under the first paragraph:

Exception in thread "main" java.lang.AssertionError: Invalid season
at TestSeason.test(Test.java:12)
at TestSeason.main(Test.java:18)

"TestSeason" should be "TestSeasons"

19. page 313
In the box "Validating Method Parameters" it is stated to not use assertions to check for valid arguments passed in to a method. On this (http://www.oracle.com/us/technologies/java/assertions-139853.html) Oracle page, it is stated that assertions can be used to enforce constraints on arguments of private methods though.
So I think it would be better to say "...to check for valid arguments passed in to non-private methods".
Also, question 10 in the review questions of chapter 6 is testing this. There is a private method that takes two arguments and one of these arguments is asserted to be greater than 0. In the answers, option E, stating that this is an appropriate use of assertions, is said to be correct.

20. page 315
First paragraph: "Checked exceptions are in the Exception class hierarchy but not the RuntimeException hierarchy. DateTimeParseException, IOException, and SQLException are common checked exceptions."

DateTimeParseException is not a checked Exception. It probably was meant to be "ParseException".

21. page 346
Second paragraph under table 7.5: "ScheduledFuture<V> is identical to the Future<V> class, except that it includes a getDelay() method that returns the delay set when the process was created."
The getDelay() method returns the remaining delay for the next execution (cf. https://docs.oracle.com/javase/8/docs/api/java/util/concurrent/Delayed.html).

22. page 363
The table at the top is a continuation of table 7.11, but doesn't have the header "Table 7.11 BlockingDeque waiting methods (continued)"

23. page 374
Requirements for reduce() arguments:

First bullet: "The identity must be defined such that for all elements in the stream u, combiner.apply(identity, u) is equal to u.": u is a result of the accumulator function, it is not an element of the stream. In the java 8 api (https://docs.oracle.com/javase/8/docs/api/java/util/stream/Stream.html#reduce-U-java.util.function.BiFunction-java.util.function.BinaryOperator-), it is said like this: "The identity value must be an identity for the combiner function. This means that for all u, combiner(identity, u) is equal to u."

Third bullet: "The combiner operator must also be associative and stateless and compatible with the identity". The combiner needs to be compatible with the accumulator function, not the identity (cf. Java 8 API - https://docs.oracle.com/javase/8/docs/api/java/util/stream/Stream.html#reduce-U-java.util.function.BiFunction-java.util.function.BinaryOperator-).

24. page 394:
Question 2:
The answers B, C, E and F do not make sense I think:

B. Callable takes a generic method argument.
C. Callable can throw a checked exception.
E. Runnable returns a generic type.
F. Callable returns a generic type.

As both Callable and Runnable are interfaces, they cannot take arguments, throw exceptions or return something. Their method can though.

25. page 417
Table 8.2 - The java.io stream classes
BufferedWriter and BufferedReader are added to this table, but BufferedInputStream and BufferedOutputStream are missing.

26. page 419
First paragraph: "Not all java.io input stream classes support this operation, and trying to call mark(int) or reset() on a class that does not support these operations will throw an exception at runtime."

mark() and reset() are documented as follows in the JAVA 8 API:

mark() in Reader:
public void mark​(int readAheadLimit) throws IOException
https://docs.oracle.com/javase/8/docs/api/java/io/Reader.html#mark-int-
Indeed an exception (i.e. IOException) will be thrown when it is not supported.

mark() in InputStream
public void mark​(int readlimit)
https://docs.oracle.com/javase/8/docs/api/java/io/InputStream.html#mark-int-
The method signature does not declare an IOException to be thrown.

reset() in Reader:
public void reset​() throws IOException
https://docs.oracle.com/javase/8/docs/api/java/io/Reader.html#reset--
Resets the stream. If the stream has been marked, then attempt to reposition it at the mark. If the stream has not been marked, then attempt to reset it in some way appropriate to the particular stream, for example by repositioning it to its starting point. Not all character-input streams support the reset() operation, and some support reset() without supporting mark().

reset() in InputStream:
public void reset​() throws IOException
https://docs.oracle.com/javase/8/docs/api/java/io/InputStream.html#reset--
(snippet) If the method markSupported returns false, then: The call to reset may throw an IOException.

Taking this into account, trying to call mark(int) or reset() on a class that does not support these operations might throw an exception at runtime, rather then will.

27. page 431
Section "Understanding object creation"

"When you deserialize an object, the constructor of the serialized class is not called. In fact, Java calls the first no-arg constructor for the first nonserializable parent class, skipping the constructors of any serialized class in between."

I've found this sentence a but ambiguous, as it might be interpreted as the first nonserializable parent class that has a no-arg constructor. It would have been more clear if it was written like this: "Java calls the non-argument constructor of the first nonserializable parent class. If this parent class does not have a non-argument constructor, an InvalidClassException is thrown".

28. page 433
Third paragraph: "Because PrintStream inherits OutputStream and PrintWriter inherits from Writer, ..."
The word "from" is missing between "inherits" and "OutputStream".

29. page 458:
The examples on page 457:

Path path1 = Paths.get("pandas","cuddly.png");
Path path2 = Paths.get("c:","zooinfo","November","employees.txt");
Path path3 = Paths.get("/","home","zoodirectory");

are repeated on page 458 with a URI:
Path path1 = Paths.get(new URI("file://pandas/cuddly.png")); // THROWS EXCEPTION AT RUNTIME
Path path2 = Paths.get(new URI("file:///c:/zoo-info/November/employees.txt"));
Path path3 = Paths.get(new URI("file:///home/zoodirectory"));

Followed by "Notice that these are actually rewrites of our earlier examples, as we can use URI values for both local and network paths."

For path2 in the examples with the URIs, c:/zoo-info should be c:/zooinfo

30. page 460:
Last sentence in the box "Path Object vs. Actual File": "As you shall see in this section, a handful of operations in the Path and Paths classes, such as Path.toRealPath(), do require the file to exist and will throw a checked exception if the file is not available."

Path.toRealPath() is the only method in Path (and Paths) that requires the file to exist and will throw a checked exception if the file is not available, in contrast to "a handful".

31. page 476:
In section "Reading and Writing File Data with newBufferedReader() and newBufferedWriter()":
In the second paragraph: "The first method, Files.newBufferedReader(Path,Charset), reads the file specified at the Path location using a java.io.BufferedReader object. It also requires a Charset value to determine what character encoding to use to read the file."
Files.newBufferedReader has an overloaded version that doesn't take a Charset.

32. page 501:
Question 16: "Assuming /squid/food-schedule.csv exists as a regular non-empty file that a program has access to read, ..."
I believe there should be an extra "to" in between "access" and "to read".

33. page 535:
Second paragraph: "On line 23, rs2 is closed because the same Statement runs another SQL statement."
"On line 23" should be "On line 22"

34. page 549:
Answer to question 14: "Code involving instanceof does not compile when there is no way for it to evaluate true.".
I believe this should be "... to evaluate to true". Furthermore, "null instanceOf SomeClass" will evaluate to false and still compile.

35. page 553:
Answer to question one of review questions chapter 13: "Since you need a List, you can eliminate C, D, and E immediately.". E is a LinkedList, so it cannot be eliminated for the reason that it's not a list.

36. page 557:
Question 11: "As written, the code doesn’t compile because the collector expects to get a String immediately before it in the chain.".
More general, the collector expects to get a CharSequence.

37. page 561:
Chapter 7 question 2: "Runnable and Callable statements both take no method arguments as input, ...".
I don't think "Runnable and Callable statements" makes sense. I would rather say "The methods run() and call() both take no method arguments as input, ..."

38. page 563:
Question 12: "Lines m2 and m3 throw a compiler warning"
I believe compiler warnings are given, generated or issued, but not thrown.
Hi Everyone,

Last week I passed the Java 8 OCP with 90%. This is how I did it.

I started with reading chapter 1 to chapter 10 of Boyarski/Selikoff's book OCP Oracle Certified Professional Java SE8 Programmer II Study guide, making sure I understood everything, marking key points per section for next study-iterations. Also did the review questions for all chapters along the way. I did this during two weeks of holidays.

The next iteration was about 6 months later, due to heavy work load at work (not ideal, as things had faded a good deal). This time focus on memorization and exercises. I remade all the exercises from the book and did a lot of extra exercises from Enthuware test bank, per topic as I was progressing in the book. Did this during the weekends, evenings and some holidays, for a lead time of 3 months. To make sure I didn't forget what was in chapter 1 till I got at chapter 10, I kept on doing Enthuware exercises for all chapters I already did during these 3 months.
During the last month before the exam, I did a final iteration of the book, and did 5 Enthuware mock exams (results: 79%, 68%, 75%, 86%, 81%), doing a thorough review of all the questions after completing an exam.

The exam is 85 questions which need to be completed in 150 minutes. I always tried to do 20 questions per 30 minutes, giving me 20 minutes of buffer at the end to do questions that were more time consuming, which I marked along the way.

I hope this will help you.

Good luck !
5 years ago
Hi Jeanne, hi Prateek,

I don't think "throws IOException" is necessary here, as none of the methods (useCallable, useSupplier and use) declare to throw an IOException. An IOException is thrown from the lambdas, but that doesn't matter.
Hi,

In chapter 3 (Core Java APIs) page 137, in the second code snippet, line 26, the following is mentioned:

list.remove(1); // throws UnsupportedOperation Exception

I think the space in between UnsupportedOperation and Exception should be removed.
I didn't find anything mentioned on it yet in the errata list or on the forum.

Hope this helps.

Kind regards,

Philippe