单项选择题

publicclassPerson{privatename;publicPerson(Stringname){this.name=name;}publicbooleanequals(Objecto){if(!oinstanceofPerson)returnfalse;Personp=(Person)o;returnp.name.equals(this.name);}}Whichistrue?()

A.CompilationfailsbecausethehashCodemethodisnotoverridden.
B.AHashSetcouldcontainmultiplePersonobjectswiththesamename.
C.AllPersonobjectswillhavethesamehashcodebecausethehashCodemethodisnotoverridden.
D.IfaHashSetcontainsmorethanonePersonobjectwithname=”Fred”,thenremovinganother
微信扫码免费搜题