梦幻西游160无级别武器:帮忙做做这几道不定项选择题吧~~!!很急~~

来源:百度文库 编辑:杭州交通信息网 时间:2024/04/28 00:57:28
我也使没办法才上来问大家答案的~~~
58.编译并运行以下程序(命令:java AB 1),关于运行结果的描述以下哪个选项是正确的( )
class AB{
public static void main(String [ ] args){
int i=0;
try{
i=Integer.parseInt(args[0]);
}catch(Exception e){ }
switch(i)
{case 0: System.out.println("0");
case 1: System.out.println("1");
default : System.out.println("default"); }
}
}
A、 编译出错 B、打印出“0” C、打印出“1” D、打印出“default”
59.Applet类特有方法有:
A、init() B、start() C、destroy()
D、stop() E 、finally()
60. class Super{
public int i=0;
public Super(String text){
i=1;}
}
public class Sub extends Super{
public Sub(String text){
i=2;
}
public static void main(String ag[]){
Sub sub=new Sub(“Hello”);
System.out.println(sub.i);
} }
What is the result?
A.Compilation will fail
B.Compilation will succeed and the program will print”0”.
C.Compilation will succeed and the program will print”1”
D.Compilation will succeed and the program will print”2”

61. 选择与第二行等价的语句?
interface foo{
int i=10;
}
A.static i=10; B.final i=10; C.public i=10;
D.protected i=10; E.private i=10;

62. 执行完以下代码int [ ] x = new int[25];后,以下哪项说明是正确的()
A、x[24]为0 B、x[24]未定义 C、x[25] 未定义 D、x[0]为空
63. 使用位操作符 “>>” 和 “>>>”. 哪个语句正确?
A. 1010 0000 0000 0000 0000 0000 0000 0000 >> 4 得
0000 1010 0000 0000 0000 0000 0000 0000
B. 1010 0000 0000 0000 0000 0000 0000 0000 >> 4得
1111 1010 0000 0000 0000 0000 0000 0000
C. 1010 0000 0000 0000 0000 0000 0000 0000 >>> 4得
0000 1010 0000 0000 0000 0000 0000 0000
D. 1010 0000 0000 0000 0000 0000 0000 0000 >>> 4得
1111 1010 0000 0000 0000 0000 0000 0000
64. 给定下面的定义:
String s = null;
哪段代码将导致一个 NullPointerException 类的异常被抛出?
A. if((s!=null)&(s.length()>0)) B. if((s!=null)&&(s.length()>0))
C. if((s==null)|(s.length()==0)) D. if((s==null)||(s.length()==0))
65. 哪个语句可以创建一个两维的整数数组?
A. int a[][] = new int[][]; B. int a[10][10] = new int[][];
C. int a[][] = new int[10][10]; D. int [][]a = new int[10][10];
E. int []a[] = new int[10][10];
66. 给定下面关于类的定义:
public class Example{
public Example(){//do something}
protected Example(int i){//do something}
protected void method(){//do something}
}
public class Hello extends Example{//member method and member variable}
下面哪些方法可以加入到 Hello类?
A. public void Example(){} B. public void method(){}
C. protected void method(){} D. private void method(){}

58. 编译并运行以下程序(命令:java AB 1),关于运行结果的描述以下哪个选项是正确的(CD )
class AB{
public static void main(String [ ] args){
int i=0;
try{
i=Integer.parseInt(args[0]);
}catch(Exception e){ }
switch(i)
{case 0: System.out.println("0");
case 1: System.out.println("1");
default : System.out.println("default"); }
}
}
A、 编译出错 B、打印出“0” C、打印出“1” D、打印出“default”
59. Applet类特有方法有:A
A、init() B、start() C、destroy()
D、stop() E 、finally()
60. class Super{ A
public int i=0;
public Super(String text){
i=1;}
}
public class Sub extends Super{
public Sub(String text){
i=2;
}
public static void main(String ag[]){
Sub sub=new Sub(“Hello”);
System.out.println(sub.i);
} }
What is the result?
A.Compilation will fail
B.Compilation will succeed and the program will print”0”.
C.Compilation will succeed and the program will print”1”
D.Compilation will succeed and the program will print”2”

61. 选择与第二行等价的语句?
interface foo{
int i=10;
}
A.static i=10; B.final i=10; C.public i=10;
D.protected i=10; E.private i=10;

62. 执行完以下代码int [ ] x = new int[25];后,以下哪项说明是正确的(A)
A、x[24]为0 B、x[24]未定义 C、x[25] 未定义 D、x[0]为空
63. 使用位操作符 “>>” 和 “>>>”. 哪个语句正确? A
A. 1010 0000 0000 0000 0000 0000 0000 0000 >> 4 得
0000 1010 0000 0000 0000 0000 0000 0000
B. 1010 0000 0000 0000 0000 0000 0000 0000 >> 4得
1111 1010 0000 0000 0000 0000 0000 0000
C. 1010 0000 0000 0000 0000 0000 0000 0000 >>> 4得
0000 1010 0000 0000 0000 0000 0000 0000
D. 1010 0000 0000 0000 0000 0000 0000 0000 >>> 4得
1111 1010 0000 0000 0000 0000 0000 0000
64. 给定下面的定义:
String s = null;
哪段代码将导致一个 NullPointerException 类的异常被抛出? A
A. if((s!=null)&(s.length()>0)) B. if((s!=null)&&(s.length()>0))
C. if((s==null)|(s.length()==0)) D. if((s==null)||(s.length()==0))
65. 哪个语句可以创建一个两维的整数数组? D
A. int a[][] = new int[][]; B. int a[10][10] = new int[][];
C. int a[][] = new int[10][10]; D. int [][]a = new int[10][10];
E. int []a[] = new int[10][10];