A.TheequalsmethoddoesNOTproperlyoverridetheObject.equalsmethod.
B.Compilationfailsbecausetheprivateattributep.namecannotbeaccessedinline5.
C.Toworkcorrectlywithhash-baseddatastructures,thisclassmustalsoimplementthehashCodemethod.
D.WhenaddingPersonobjectstoajava.util.Setcollection,theequalsmethodinline4willpreventduplicates.
- · 有5位网友选择 A,占比29.41%
- · 有5位网友选择 B,占比29.41%
- · 有4位网友选择 B,占比23.53%
- · 有3位网友选择 A,占比17.65%