移动端

  • 题王微信公众号

    题王微信公众号

    微信搜“题王网”真题密题、最新资讯、考试攻略、轻松拿下考试

单选题

import java.util.*;  class KeyMaster {  public int i;  public KeyMaster(int i) { this.i = i; }  public boolean equals(Object o) { return i == ((KeyMaster)o).i; }  public int hashCode() { return i; }  }  public class MapIt {  public static void main(String[] args) {  Set set = new HashSet();  KeyMaster k1 = new KeyMaster(1);  KeyMaster k2 = new KeyMaster(2);  set.add(k1); set.add(k1);  set.add(k2); set.add(k2);  System.out.print(set.size() + “:”);  k2.i = 1;  System.out.print(set.size() + “:”);  set.remove(k1);  System.out.print(set.size() + “:”);  set.remove(k2);  System.out.print(set.size()); }  }  What is the result?() 

发布日期:2021-07-20

import java.util.*;  class KeyMaster {  public int...
A

4:4:2:2

B

4:4:3:2

C

2:2:1:0

D

2:2:0:0

E

2:1:0:0

F

2:2:1:1

G

4:3:2:1

标签: "暂无标签"

题王网让考试变得更简单

扫码关注题王,更多免费功能准备上线!

此试题出现在

Java认证考试

SCJP程序员认证考试

去刷题