[OCP 11 Complete Study Guide] [OCP 11 Programmer I Book] [OCP 11 Programmer II Book] [OCP 11 Practice Tests Book] [OCA 8 Book] [OCP 8 Book] [OCP 8 Practice Tests Book] [Blog]
[OCP 17 book] | [OCP 11 book] | [OCA 8 book] [OCP 8 book] [Practice tests book] [Blog] [JavaRanch FAQ] [How To Ask Questions] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
[OCP 17 book] | [OCP 11 book] | [OCA 8 book] [OCP 8 book] [Practice tests book] [Blog] [JavaRanch FAQ] [How To Ask Questions] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
Page | Where | Issue |
130 | Table 3.4 | "void add (E element)" should be "boolean add (E element)" |
157 | Last sentence | In a nutshell computeIfPresent() calls the BiFunction if the requested key is found". This is true only if the associated key is not null. I suggest you add "… and the associated key is not null" to this sentence |
159 | Table 3.12 | The "computeIfAbsent" column for row "null value in map" and "Not null" should say "Set key to mapping function result" rather than "Add key to map with mapping function result as value" because the key already exists in the map (although it has a null value associated) |
160 | Last sentence of 2nd paragraph | The compiler does not raise any error when attempting to remove an item from an unbounded or upper-bounded wildcard list. This actually compiles and runs fine |
218 | 2nd sentence | "rather than the Collector class" should be "rather than the Collector interface" |
265 | Table 5.8 | For matching resource bundle "Zoo_fr_FR.java", files keys can also come from Zoo_fr.properties and Zoo.properties (if Zoo_fr.java and Zoo.java are not present). For matching resource bundle "Zoo_fr.properties", keys can also come from Zoo.java (Zoo.java will be chosen in priority over Zoo.priorities if both are present) |
315 | 1st paragraph | DateTimeParseException is not a checked exception in contrary to IOException and SQLException |
340 | Table 7.3 | In the description of the second row, "completely" should be replaced by "completed" |
352 | First sentence | In "results from earlier threads are output before ones that started later", "before" should be replaced by "after" |
408 | 3rd sentence | In "Alternatively, the relative path … from the current working directory to file or directory", "to file or directory" should read "to a file or directory" |
425 | Last sentence of 3rd paragraph | "we have access to the all of the methods" should read "we have access to all of the methods" |
467 | relativize() section | I find that the example for relativize() is confusing when used with files because the relative path from fish.txt to birds.txt should be "./birds.txt" instead of "../birds.txt". According to Java documentation, relativize does the contrary of resolve and resolve considers by default that the path on which it is called is a directory. So presumably, Java makes the same assumption for relativize(), i.e. it considers by default that the path on which it is called is a directory, which explains the .. |
475 | 3rd sentence of "Removing a File with delete and deleteIfExists" section | In "…, the operation will throw the runtime DirectoryNotEmptyException", "runtime" is not correct as this exception is a checked exception. You may want to remove "the runtime" and maybe add "at runtime" after "DirectoryNotEmptyException" ? |
478 | Last sentence of 4th paragraph | In "For example, some operating systems may not have a notion of user-level permissions, …", "may not" should be replaced by "may" |
525 | In the 2nd sample showing how to retrieve the number of rows of the animal table | rs.getInt("count") throws an exception because the "count" column is unknown (it is known as "1" instead) |
527 | Table 10.6 | getTimeStamp() and java.sql.TimeStamp should respectively read getTimestamp() and java.sql.Timestamp |
531 | Last sentence | This sentence is confusing, it seems like relative() may return something else than a boolean if the cursor is not pointing to a row with data. This sentence should rather mention that relative() returns false if the cursor is not pointing to a row with data |
562 | Answer to question 3 | Line w4 does not handle the InterruptedException and ExecutionException that may be thrown by calling result.get() so I would argue that E would be a correct answer. (line w4 would need to be wrapped in a try catch statement) |
566 | Answer to question 12 | Answer D is also valid. A File object is correctly created on a Windows OS when using // instead of /. Calling the exists() method on this file object does return true if the file exists which proves that it works fine. Although this is a valid answer I think it brings confusion as, as I understand it, it is not something we should consider as a good practive to create a File object. |
Mock exam 2 | Question "What changes need to be made to make the following singleton pattern correct | The exhibitionManager variable should be private instead of public in the code sample (otherwise encapsulation of the singleton variable is not correctly implemented). Alternatively there should be an addition answer in the lines of "Change the access modifier of the exhibitionManager variable from public to private |
Assume the following:
Missing package and import statements: If sample code do not include package or import statements, and the question does not explicitly refer to these missing statements, then assume that all sample code is in the same package, and import statements exist to support them.
No file or directory path names for classes: If a question does not state the file names or directory locations of classes, then assume one of the following, whichever will enable the code to compile and run:
All classes are in one file
Each class is contained in a separate file, and all files are in one directory
Unintended line breaks: Sample code might have unintended line breaks. If you see a line of code that looks like it has wrapped, and this creates a situation where the wrapping is significant (for example, a quoted String literal has wrapped), assume that the wrapping is an extension of the same line, and the line does not contain a hard carriage return that would cause a compilation failure.
Code fragments: A code fragment is a small section of source code that is presented without its context. Assume that all necessary supporting code exists is present and that the supporting environment fully supports the correct compilation and execution of the code shown and its omitted environment.
Descriptive comments: Take descriptive comments, such as "setter and getters go here," at face value. Assume that correct code exists, compiles, and runs successfully to create the described effect.
[OCP 17 book] | [OCP 11 book] | [OCA 8 book] [OCP 8 book] [Practice tests book] [Blog] [JavaRanch FAQ] [How To Ask Questions] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
[OCP 17 book] | [OCP 11 book] | [OCA 8 book] [OCP 8 book] [Practice tests book] [Blog] [JavaRanch FAQ] [How To Ask Questions] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
[OCP 17 book] | [OCP 11 book] | [OCA 8 book] [OCP 8 book] [Practice tests book] [Blog] [JavaRanch FAQ] [How To Ask Questions] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
157 Last sentence
In a nutshell computeIfPresent() calls the BiFunction if the requested key is found". This is true only if the associated key is not null. I suggest you add "… and the associated key is not null" to this sentence
Life just hasn't been the same since the volcano erupted and now the air is full of tiny ads.
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
|