[2,19,11,35,26,49,27,55,37,58,44,75,48,83,60,84,91,93];
正确答案:B 19.
(单选)下列关于IDE开发环境Eclipse,说法错误的是:()。 A.
Eclipse可以通过插件(plugin)的方式扩展其功能。 B.
Eclipse联盟是由IBM公司捐资组建的。 C.
Eclipse使用了SWT图形界面技术。 D.
Eclipse的运行不需要有JRE的支持。
正确答案:D 20.
(单选)下列数组声明语句中,错误的是:()。 A.
int[] arr = new int[8]; B.
int[] arr = new int[8]{}; C.
int[] arr = {}; D.
int[] arr = new int[]{};
正确答案:B 21.
(单选)运行下面的程序: String[] fileNames = { \\\\}; for (String fileName : fileNames) { if (fileName.endsWith(\
{ System.out.print(fileName.substring(0, fileName .lastIndexOf(\控制台的输出结果是:()。 A.
bcd. cde. efg. B.
bc cd ef C.
bcd.exe cde.exe efg.exe D.
bcd cde efg
正确答案:D 22.
(单选)下列代码编译和运行的结果是: public class Wow { public static void go(short n) { System.out.println(\} public static void go(Short n) { System.out.println(\} public static void go(Long n) { System.out.println(\{ Short y = 6; int z = 7; go(y); go(z); } } A.
short LONG B.
SHORT LONG C.
编译失败 D.
抛出运行时异常
正确答案:C 23.
(单选题)下列运算结果正确的是:()。 A.
double d = 2.5*2.5; d结果为6.25
B.
double d = 3/4+0.25; d结果为1.0 C.
double d = 5/2 + 2.5; d结果为5.0 D.
double d = 3.0 - 2.6; d结果为3.4
正确答案:A选项A 2.5可以不失精度转换成2进制,所以计算结果是正确的6.25 选项B 3/4java默认整型都是int,3/4运算结果为0 所以运算结果为0.25 选项C 同选项B,5/2java运算结果为2,所以运算结果为4.5 选项D 2.6转换成二进制会损失精度,所以运算结果为0.3999999999999999 24.
(单选)程序的执行结果是: public class Test { public static void main(String[] args){ String str1 = new String(\String str2 = new String(\String str3 = str1; if(str1.equals(str2)){ System.out.println(\}else{ System.out.println(\} if(str1==str3){ System.out.println(\ A.
true true B.
true false C.
false true D.
false false
正确答案:A 25.
(单选)请看下列代码: public class Plant { private String name; public Plant(String name) { this.name = name; } public String getName() { return name; } } class Tree extends Plant { public void growFruit() { } public void dropLeaves() { } } 下列说法正确的是: A.
在Tree类中添加代码:public Tree() { Plant(); },编译将通过
B.
在Plant类中添加代码:public Plant() { Tree(); },编译将通过 C.
在Plant类中添加代码:public Plant() { this(”fern”); },编译将通过 D.
在Plant类中添加代码:public Plant() { Plant(”fern”); },编译将通过
正确答案:C 26.
(单选题)数据类型int、char和double所占用内存字节数分别是:()。 A. 4、2和8 B.
2、2和4 C.
2、1和8 D.
4、4和4
正确答案:A原题 27.
(单选)请看下列代码编译和运行的结果是: package packagea; public class Message { String getText() { return \} } package packageb; public class XMLMessage extends packagea.Message{ String getText() { return \args) { System.out.println(new XMLMessage().getText()); } } A. text B.
相关推荐: