单选题:Given code below:
Given code below:
```JAVA
Set s = new HashSet();
s.add(1);
s.add(2);
s.add(1);
```
Which statement below is correct? @[A](2)
A. It compiles, but only two element left in s
B. It does not compile because 1 and 2 are not objects of Integer
C. It compiles but exception raises at line 2, for 1 is not an objects of Integer
D. It compiles but exception raises at line 4, for 1 is already in the set
A.It compiles, but only two element left in s
B.It does not compile because 1 and 2 are not objects of Integer
C.It compiles but exception raises at line 2, for 1 is not an objects of Integer
D.It compiles but exception raises at line 4, for 1 is already in the set
答案:A
```JAVA
Set
s.add(1);
s.add(2);
s.add(1);
```
Which statement below is correct? @[A](2)
A. It compiles, but only two element left in s
B. It does not compile because 1 and 2 are not objects of Integer
C. It compiles but exception raises at line 2, for 1 is not an objects of Integer
D. It compiles but exception raises at line 4, for 1 is already in the set
A.It compiles, but only two element left in s
B.It does not compile because 1 and 2 are not objects of Integer
C.It compiles but exception raises at line 2, for 1 is not an objects of Integer
D.It compiles but exception raises at line 4, for 1 is already in the set
答案:A