Java expert please help me QUESTION 34 Which of the following best describes Sal
ID: 3834216 • Letter: J
Question
Java expert please help me
QUESTION 34
Which of the following best describes Sally?
A - Sally cannot be used in a HashSet because it is not serializable
B - Sally will not compile because to override equals, the signature must be boolean equals(Sally obj)
C - Sally should not be used in a HashSet because equal objects may have different hash values.
D - Sally can be used in a HashSet, but the HashSet will perform poorly because of collisions
QUESTION 35
If no locale is explicitly supplied for user messages, the system uses messages associated with US English.
True
False
QUESTION 36
You should always invoke the unlock method in the finally clause.
true
false
QUESTION 37
Under what conditions are locks unnecessary for multi-threaded programs?
A- when the threads are different classes
B- when the threads do not share data
C - when the shared data only has a single method
D - when the threads are all of the same class
A - Sally cannot be used in a HashSet because it is not serializable
B - Sally will not compile because to override equals, the signature must be boolean equals(Sally obj)
C - Sally should not be used in a HashSet because equal objects may have different hash values.
D - Sally can be used in a HashSet, but the HashSet will perform poorly because of collisions
Explanation / Answer
37. OptionB- when the threads do not share data
When the threads do not share data, locks are not required for multi-threaded programs.
36. True
Yes, we should always invoke the unlock method in the finally clause.
35. True
34. Option C
C - Sally should not be used in a HashSet because equal objects may have different hash values.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.