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”
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”
安装配置开发环境 http://dev.yesky.com/javarumen/javasetup/
Java基础类 http://dev.yesky.com/javarumen/javabase/
Swing编程 http://dev.yesky.com/javarumen/javaswing/
Java Applet编程 http://dev.yesky.com/javarumen/javaapplet/
线程与多线程 http://dev.yesky.com/javagaoji/xiancheng/
XML开发 http://dev.yesky.com/javagaoji/xml/
数据库 http