单选题

Given: Which statement is true?()

AThe equals method does NOT properly override the Object.equals method.

BCompilation fails because the private attribute p.name cannot be accessed in line 5.

CTo work correctly with hash-based data structures,this class must also implement the hashCode method.

DWhen adding Person objects to a java.util.Set collection,the equals method in line 4 will prevent duplicates.

正确答案

来源:www.examk.com

答案解析

相似试题
  • Given: Which statement is true?()

    单选题查看答案

  • Given: Which is true?()

    单选题查看答案

  • Given: Which three are true?()

    多选题查看答案

  • Given: Which statement is true?()

    单选题查看答案

  • Given: Which statement is true?()

    单选题查看答案

  • Given: Which statement is true?()

    单选题查看答案

  • Given: Which statement is true?()

    单选题查看答案

  • Given: Which two are true?()

    多选题查看答案

  • Given: Which statement is true?()

    单选题查看答案