Finally, the declaration of thursday does not compile because the final modifier cannot appear before the access modifier.
5: Locale.setDefault(new Locale("en", "AU"));
The three lines printed by the code are ko, en_US and en.
Juerg Bauman wrote:Chapter 11 - question 23: (page 197/489)
Option A is allowed because the turnOn() method is public and can be called from anywhere.
This is not correct. The class com.light.Flashlight has no access modifier (=package-protected) and is therefore not visible by any class in package com.dark.
The correct answers should be: A and C
Juerg Bauman wrote:Page 492 - explanation 14:
typing error --> For these reasons ...
Juerg Bauman wrote:Page 492 - explanation 15:
The constructor for an enum type must be package-private or private access.
Juerg Bauman wrote:Page 505 - explanation #31:
It should be: ... It uses the method applyAsDouble().
Juerg Bauman wrote:Page 549, explanation #30:
The incorrect code is on line 9.
Juerg Bauman wrote:Page 537 - explanation 15:
There is another error, since f.get() throws checked exceptions, which have to be caught or declared.
This doesn't affect the correct answer, which remains B.
Juerg Bauman wrote:Page 538, explanation #21:
Just a typo...
Juerg Bauman wrote:Page 538, explanation #23:
The variable count is a primitive of type int and several threads are updating it. To avoid race condition it should be declared as AtomicInteger instead of int?
Juerg Bauman wrote:Page 540 - explanation #33:
It's the opposite: If offer() had been used instead of push() ...
Juerg Bauman wrote:Page 302 - question#4:
I'm not english native, but something is wrong with that sentence.
Juerg Bauman wrote:Page 304 - question#10:
Typo: For a given file, the absolute path is the path ..
Juerg Bauman wrote:
Post 2/7/2018 6:12:56 AM Subject: Sybex OCA OCP Practice Test - Errata
Page 196 - question#21 (singleton pattern):
It's just a doubt, probably not an error.
Juerg Bauman wrote:Page 494 - explanation #29:
Option C is not working even for static nested classes. The correct syntax would be: new Dinosaur.Pterodactyl() or just new Pterodactyl()
Juerg Bauman wrote:Page 504 - explanation #22:
It should be reverse: ... is used for Consumer, not Supplier, ...
Juerg Bauman wrote:On page 345 - question #19: not an error, just a suggestion
I was surprised that this line actually did compile, because execute() takes a Runnable with return type void. The method getAnswer() has return type String.
The explanation: https://coderanch.com/t/690723/java/ExecutorService-execute-Runnable
Possibly I didn't get that fact earlier, maybe you could add it to your explanation.
Juerg Bauman wrote:Page 523 - explanation#15:
OutputStream uses byte, while Writer uses char.
Juerg Bauman wrote:Page 361 - question#18:
It should be: select from books ...
Juerg Bauman wrote:Page 542 - explanation#2:
just a typo
Juerg Bauman wrote:Page 410 and 558 - question#49:
The method compareTo() belongs to Comparable which is implemented on the class being compared.
There can be only one implementation, which should follow the contract: compareTo should return 0 if equals returns true.
So answer E should be true, but not always will...
By the way is " ... multiple comparators" meant with Uppercase Comparators?
Juerg Bauman wrote:Page 561 - explanation#67:
there is a fourth error on line 12, since Function apply() takes just one argument, not two.
The answer remains correct: E
Juerg Bauman wrote:Page 562 - explanation#80:
It should be: ... does not is checked and must ...
Juerg Bauman wrote:Page 496 - explanation#2:
There is no such method available in List, there is one called replaceAll().
Juerg Bauman wrote:Page 452 - explanation#4:
The result is a compiler error, not an exception at runtime.