-->
当前位置:首页 > 题库 > 正文内容

单选题:Given code below:

Luz4年前 (2021-05-10)题库1539
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

发表评论

访客

◎欢迎参与讨论,请在这里发表您的看法和观点。