当前位置: 技术问答>java相关
一个SCJP试题
来源: 互联网 发布时间:2015-08-22
本文导语: Given: Integer i = new Integer (42); Long j = new Long (42); Double d = new Double (42.0); Which two expressions evaluate to True...
Given:
Integer i = new Integer (42);
Long j = new Long (42);
Double d = new Double (42.0);
Which two expressions evaluate to True? (Choose Two)
A. (i ==j)
B. (j == d)
C. (d == j)
D. (i.equals (d))
E. (d.equals (i))
F. (i.equals (42))
标准答案是D,E。但是我在编译运行后却发现没有一个答案是
正确的。why?
Integer i = new Integer (42);
Long j = new Long (42);
Double d = new Double (42.0);
Which two expressions evaluate to True? (Choose Two)
A. (i ==j)
B. (j == d)
C. (d == j)
D. (i.equals (d))
E. (d.equals (i))
F. (i.equals (42))
标准答案是D,E。但是我在编译运行后却发现没有一个答案是
正确的。why?
|
看清楚题目,试试那个能编译通过啊,只有d、e能编译通过