题目内容

对于如下代码,下列哪个叙述是正确的?public class E { public static void main (String args[]) { String s1 = args[1]; String s2 = args[2]; String s3 = args[3]; System.out.println(s3); }}

A. 程序出现编译错误。
B. 无编译错误,在命令行执行程序:“java E I love this game”,程序输出this。
C. 无编译错误,在命令行执行程序:“java E let us go”,程序无运行异常。
D. 无编译错误,在命令行执行程序:“java E 0 1 2 3 4 5 6 7 8 9”程序输出3。

查看答案
更多问题

为一个boolean类型变量赋值时,可以使用()方式

A. boolean=0
B. booleana=(8>=9)
C. booleana="假"
D. booleana==true

以下程序段输出结果的是()public class Test{ public static void main(String args[]){String str="ABCDEF";str.substring(3);str.concat("XYZ");System.out.print(str);}}

A. DEF
B. DEXYZ
C. ABCDEF
D. CDEXYZ

下列代码得到1至100之间的一个随机整数(包括1和100)。

A. (int)Math.random()*100
B. (int)(Math.random()*10)+1
C. (int)(Math.random()*100)+1
D. (int)Math.random()*10

对于下列代码:A)String str1="mycode";B)String str2="mycode";C)String str3=new String("mycode");D)StringBuffer str4=new StringBuffer("mycode");以下表达式的值为true的是( )

A. str1==str2
B. str1==str4
C. str2==str3
D. str3==str4

答案查题题库