JAVA SOS啊

来源:百度知道 编辑:UC知道 时间:2024/05/09 19:52:39
三、不定项选择题()
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”