AprogrammerisdevelopingaclassKey,thatwillbeusedasakeyinastandardjava.util.HashMap.WhichtwomethodsshouldbeoverriddentoassurethatKeyworkscorrectlyasakey?()A.publicinthashCode()B.publicvoidhashCode()C.publicintcompareTo(Objecto)D.publicbooleanequals(Objecto)

题目
AprogrammerisdevelopingaclassKey,thatwillbeusedasakeyinastandardjava.util.HashMap.WhichtwomethodsshouldbeoverriddentoassurethatKeyworkscorrectlyasakey?()

A.publicinthashCode()

B.publicvoidhashCode()

C.publicintcompareTo(Objecto)

D.publicbooleanequals(Objecto)

E.publicbooleancompareTo(Keyk)


相似考题
参考答案和解析
参考答案:A, D