Home / Java Programming / Objects and Collections :: Discussion

Discussion :: Objects and Collections

  1. Which class does not override the equals() and hashCode() methods, inheriting them directly from class Object?

  2. A.
    java.lang.String
    B.
    java.lang.Double
    C.
    java.lang.StringBuffer
    D.
    java.lang.Character

    View Answer

    Workspace

    Answer : Option C

    Explanation :

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


Be The First To Comment