欢迎来到计算机考试题库网 计算机题库官网
logo
全部科目 > Java认证考试 > SCJP程序员认证考试

单项选择题

Which statement is true?()

    A.The equals method does NOT properly override the Object.equals method.
    B.Compilation fails because the private attribute p.name cannot be accessed in line 5.
    C.To work correctly with hash-based data structures, this class must also implement the hashCode method.
    D.When adding Person objects to a java.util.Set collection, the equals method in line 4 will prevent duplicates.

点击查看答案

相关考题

  • 单项选择题
    Which change can you make to Target without affecting Client?()

    A.Line 4 of class Target can be changed to return i++;
    B.Line 2 of class Target can be changed to private int i = 1;
    C.Line 3 of class Target can be changed to private int addOne(){};
    D.Line 2 of class Target can be changed to private Integer i = 0;

  • 单项选择题
    What is the result?()

    A.0
    B.1
    C.4
    D.Compilation fails.
    E.An exception is thrown at runtime.

  • 多项选择题
    WhichtwoscenariosareNOTsafetoreplaceaStringBufferobjectwithaStringBuilderobject?()

    A.When using versions of Java technology earlier than 5.0.
    B.When sharing a StringBuffer among multiple threads.
    C.When using the java.io class StringBufferInputStream.
    D.When you plan to reuse the StringBuffer to build more than one string.
    E.Enitiation of separate design processes to the separation of users

微信小程序免费搜题
微信扫一扫,加关注免费搜题

微信扫一扫,加关注免费搜题