Java Programming - Objects and Collections - Discussion

Discussion Forum : Objects and Collections - General Questions (Q.No. 2)
2.
Which class does not override the equals() and hashCode() methods, inheriting them directly from class Object?
java.lang.String
java.lang.Double
java.lang.StringBuffer
java.lang.Character
Answer: Option
Explanation:

java.lang.StringBuffer is the only class in the list that uses the default methods provided by class Object.

Discussion:
15 comments Page 2 of 2.

Gayudhaya said:   8 years ago
I didn't understand it can you give a clear explanation?

G Sunil Kumar said:   1 decade ago
Why the special behavior for StringBuffer class only?

Anoop kumar said:   8 years ago
Please tell me, what you mean by overriding?

SArfaraz Ahamad said:   1 decade ago
But String class is not Wrapper class.

Vidya said:   2 decades ago
can u give me the clear discription?


Post your comments here:

Your comments will be displayed after verification.