艾融软件模拟测试题_001_0007_java专题

您的姓名:
61.关于sleep()和wait(),以下描述错误的一项是()
62.下面能让线程停止执行的有(多选)()
63.下面哪个可以改变容器的布局?()
65.提供Java存取数据库能力的包是()
66.不能用来修饰interface的有()
67.下列说法错误的有()
68.从下面四段()代码中选择出正确的代码段()
69.选择下面代码的运行结果:()。
public class Test{
public void method() {
for(int i = 0; i < 3; i++) {
System.out.print(i);
}
System.out.print(i);
}
}
70.请看如下代码
class Person {
private int a;
public int change(int m){
return m;
}
}
public class Teacher extends Person{
public int b;
public static void main(String arg[]){
Person p = new Person();
Teacher t = new Teacher();
int i; // point x
}
}
下面哪些放在// point x?行是正确的?
71下面那几个函数是public void method(){...}的重载函数?()
72.给出如下声明: ()String s = “Example”; 合法的代码由哪些?
73.如下哪些不是java的关键字?()
74.已知表达式 int m [ ] = {0,1,2,3,4,5,6};下面哪个表达式的值与数组下标量总数相等?()
75.方法resume()负责恢复哪些线程的执行()
76.有关线程的哪些叙述是对的()
77.已知如下代码:()
public class Test{
public static void main(String arg[] ){
int i = 5;
do{
System.out.print(i);
}while(--i>5)
System.out.print(“finished”);
}
}执行后的输出是什么?
78.下面的哪些声明是合法的?()
79.给出如下代码:()
class Test{
private int m;
public static void fun() {
//some code„
}
}
如何使成员变量m被函数fun()直接访问?
80.以下哪个方法用于定义线程的执行体?()
81.给出下面的代码段:()
public class Base{
int w, x, y, z;
public Base(int a, int b) {
x=a; y=b;
}
public Base(int a, int b, int c, int d) {
//assignment x=a, y=b
w=d;z=c;
}
}
在代码说明//assignment x=a, y=b处写下如下哪几个代码是正确的?()
82.关于运算符>>和>>>描述正确的是 ()
83. 选择Java语言中的基本数据类型()
84.从下列选项中选择正确的Java表达式()
85. Java I/O程序设计中,下列描述正确的是()
86.下述代码的执行结果是()
class Super {
public int getLength() {
return 4;
}
}
public class Sub extends Super {
public long getLength() {
return 5;
}
public static void main (String[]args) {
Super sooper = new Super ();
Super sub = new Sub();
System.out.printIn(sooper.getLength()+ “,” + sub.getLength() );
}
}
87、Which two demonstrate a "has a" relationship(Choose two)?()
88. Given the folowing classes which of the following will compile with error?
interface IFace{}
class CFace implements IFace{}
class Base{}
public class ObRef extends Base{
public static void main(String argv[]){
ObRef ob = new ObRef();
Base b = new Base();
Object o1 = new Object();
IFace o2 = new CFace();
}
}
89. 关于Java语言,下列描述正确的是()
90. 指出下列程序运行的结果()
public class Example{
String str=new String("good");
char[]ch={'a','b','c'};
public static void main(String args[]){
Example ex=new Example();
ex.change(ex.str,ex.ch);
System.out.print(ex.str+" and ");
System.out.print(ex.ch);
}
public void change(String str,char ch[]){
str="test ok"; ch[0]='g';
}
}
41、Which code determines the int value foo closest to a double value bar?( DEF
)
二.简答题:(每题5分,共20分)
1.描述J2EE框架的多层结构,并简要说明各层的作用。
三.编程题:(每题8分,共16分)
1.编写代码实现同一平面内两圆是否碰撞,其中:第一个圆圆心坐标为(x1,y1),半径是r1,第二个圆圆心坐标为(x2,y2),半径是r2。方法声明如下:boolean collisWith(int x1,int y1,int r1,int x2,int y2,int r2){}
2.用递归方法实现正序显示数组元素。例如String[] s = {“a”,”b”,”c”,”d”};
方法声明如下:void print(String[] s,int i){ }
3.请写出求n!的算法。
更多问卷 复制此问卷