单选题:Given code below:
Given code below:
```Java
class Value {
int i;
}
public class Test {
public static void main(String[] argv) {
Integer v1 = 39;
Integer v2 = 39;
System.out.println(v1.equals(v2));
}
}
```
Which of the following statement is true? @[B](2)
A. It does not compile because of line 6 and 7, that the type are not match for assignment operator.
B. It compiles and print out “true”.
C. It compiles and print out “false”.
D. It compiles but exception raises for line 6 at run time: type mismatch.
A.It does not compile because of line 6 and 7, that the type are not match for assignment operator.
B.It compiles and print out “true”.
C.It compiles and print out “false”.
D.It compiles but exception raises for line 6 at run time: type mismatch.
答案:B
```Java
class Value {
int i;
}
public class Test {
public static void main(String[] argv) {
Integer v1 = 39;
Integer v2 = 39;
System.out.println(v1.equals(v2));
}
}
```
Which of the following statement is true? @[B](2)
A. It does not compile because of line 6 and 7, that the type are not match for assignment operator.
B. It compiles and print out “true”.
C. It compiles and print out “false”.
D. It compiles but exception raises for line 6 at run time: type mismatch.
A.It does not compile because of line 6 and 7, that the type are not match for assignment operator.
B.It compiles and print out “true”.
C.It compiles and print out “false”.
D.It compiles but exception raises for line 6 at run time: type mismatch.
答案:B