目录:
1. 软通动力信息技术(集团)有限公司Java招聘笔试题
2. 软通动力JAVA笔试题
3. 软通动力笔试题(JAVA开发工程师)
内容节选:
软通动力笔试题(JAVA开发工程师)
请勿在纸上答题及写任何字体!
一. 选择题(每题3分)
1、给出如下代码:
public class MethodOver {
public void setVar (int a, int b, float c) {
}
}
哪两个是setVar的重载函数?
A. Private void setVar (int a, float c, int b) { }
B. Protected void setVar (int a, int b, float c) { }
C. Public int setVar (int a, float c, int b) (return a;)
D. Public int setVar (int a, int b, float c) (return a;)
E. Protected float setVar (int a, int b, float c) (return c;)
答:A,C
2、给出如下代码:
int i =1,j =10;
do {
if(i++> --j) {
continue;
}
} while (i <5);
System.out.println(“i = “ +i+ “and j = “+j);
程序运行结果是什么?
A. i = 6 and j = 5 B. i = 5 and j = 5 C. i = 6 and j = 5
D. i = 5 and j = 6 E. i = 6 and j = 6
答:D
3、哪两个不能直接停止线程的执行?
A. Existing from a synchronized block.
B. Calling the wait method on an object.
C. Calling notify method on an object.
D. Calling read method on an InputStream object.
E. Calling the SetPriority method on a Thread object.
4、给出如下代码:
class Test{
private int m;
public static void fun() {
// some code...
}
}
如何使成员变量m被函数fun()直接访问?
A、将private int m改为protected int m B、将private int m改为public int m
C、将private int m 改为static int m D、将private int m改为int m
答:C
5、给出下面的代码段:
、、、、、