Eddy Seager
You're welcome.
SCJP 6, SCWCD 5
Larry Chung wrote:Chapter 6 Self Test, Question 7, page (unknown because I am using an online version of K&B).
INCORRECT:
"...and the output is ''false true''; which set(s) of code fragments must be inserted? (Choose all that apply.) "
CORRECT:
"...and the output is ''false false''; which set(s) of code fragments must be inserted? (Choose all that apply.) "
Ancat Dubher wrote:Another one.
The Exam Watch box on page 563 says "HashSet and LinkedHashSet must override hashcode(), else Set might allow objects that could be meaningfully equal". This should really say the equals() method, rather than the hashcode() method.
When using HashSet or LinkedHashSet, the objects you add to them must override equals() and hashcode(). If they don't override equals() and hashcode(), the default Object.equals() or Object.hashcode() method will allow multiple objects that you might consider "meaningfully equal" to be added to your "no duplicates allowed" set.
Jerome Jacobsen wrote:Chapter 6, Self Test Question #11, p. 537
Your explanation states the B would be correct if a char[] was used instead of a String. For B to be correct it would have to look like this:
username: fred
hello fred
password:
It is missing the "hello fred" that was output on line 8 of the code.
Andreas Schreiber wrote:
Jerome Jacobsen wrote:Chapter 6, Self Test Question #11, p. 537
Your explanation states the B would be correct if a char[] was used instead of a String. For B to be correct it would have to look like this:
username: fred
hello fred
password:
It is missing the "hello fred" that was output on line 8 of the code.
To preserve the presumed intent of the question a better change would be to remove line 8 completely from here and on page 523.
Spot false dilemmas now, ask me how!
(If you're not on the edge, you're taking up too much room.)
No cast is needed in this case because d double can hold every piece of information that a long can store.
SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
OCPJP 6.0-81% | Preparing for OCWCD
http://www.certpal.com/blogs/cert-articles | http://sites.google.com/site/mostlyjava/scwcd |
SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
OCPJP 6.0-81% | Preparing for OCWCD
http://www.certpal.com/blogs/cert-articles | http://sites.google.com/site/mostlyjava/scwcd |
fadi aboona wrote:Page: 136 Chapter 2.
It says:
How do you know what the default constructor will look like?
Because....
The default constructor has the same access modifier as the class.
I wrote a public class with a private constructor and the code complied just fine.
in fact page 133 says:
Constructors can use any access modifier, including private.
Anyone can confirm this?
Thanks,
OCPJP 6 96%
Francisco J. Bermejo wrote:
fadi aboona wrote:Page: 136 Chapter 2.
It says:
How do you know what the default constructor will look like?
Because....
The default constructor has the same access modifier as the class.
I wrote a public class with a private constructor and the code complied just fine.
in fact page 133 says:
Constructors can use any access modifier, including private.
Anyone can confirm this?
Thanks,
Hello fadi, I think the book is correct. The default constructor is automatically generated by the compiler only when you don't type a constructor by yourself. And yes, the default constructor will have the same access modifier as the class.
Hope it helps!![]()
PS: by the way you should post any errata which is not confirmed in this thread: https://coderanch.com/t/499740/java-programmer-SCJP/certification/Discussing-errata-SCJ
Spot false dilemmas now, ask me how!
(If you're not on the edge, you're taking up too much room.)
OCPJP 6.0
In the preceding example, we created a method called getDate() that returns a Date object. This method creates two objects: a Date and a StringBuffer containing the date information. Since the method returns the Date object, it will not be eligible for collection even after the method has completed. The StringBuffer object, though, will be eligible, even though we didn't explicitly set the now variable to null.
Bert Bates wrote:bump
Hey Guys,
At long last I've started working on an organized errata list for K&B 6. Should be ready soon.
In the meantime this list is pretty good, if unorganized.
thanks,
Bert
Robert Lilly
Robert Lilly wrote:
Bert Bates wrote:bump
Hey Guys,
At long last I've started working on an organized errata list for K&B 6. Should be ready soon.
In the meantime this list is pretty good, if unorganized.
thanks,
Bert
Any progress with the compiled list? I'm just beginning my studies for the OCJP 6 with the K&B 6 book. It would be helpful if I had an organized list of the errata to make notes for in my book.
Thanks,
Robert
Short and Integer from -128 to 127
Rik Roos wrote:If not already mentioned but on page 246 ( object equation by autoboxing):
Last bullet :
Short and Integer from -128 to 127
This should be:
Short and Integer and Long from -128 to 127
Tongue wrestling. It's not what you think. And here, take this tiny ad. You'll need it.
Smokeless wood heat with a rocket mass heater
https://woodheat.net
|