分析下面的C#代码,该程序的运行结果是()。classExample{staticvoidMain(string[args){int0a={1
A.WriteLine(a[3]);}}
B.1
C.2
D.3
E.4
A.WriteLine(a[3]);}}
B.1
C.2
D.3
E.4
第1题
分析下面的C#代码,该程序的运行结果是()。classExample{staticvoidMain(stringQ
args){Console.WriteLine("/Looklikeacomment");}}
A.LookslikeA.comment
B./LookslikeA.comment
C.没有输出任何内容
D.编译错误
第2题
;Console.WriteLine("s="+s);}}
A.无内容输出
B.代码编译失败
C.打印输出null
D.打印输出s=null
第3题
分析下面的C#代码,该程序的运行结果是()。classExample{staticstrings1;staticstring
s2;staticvoidMain(stringDargs){s2=s1+s2;Console.WriteLine(s2);}}
A.代码编译失败
B.运行时错误,抛出NullPointerException异常
C.打印输出nullnull
D.代码编译成功,打印输出内容为空白行
第4题
分析下面的C#代码,该程序的运行结果是()。classExample{staticvoidMain(string]
args){intindex=1;int]foo=newint[3];intbar=foo[index];intbaz=bar+index;
Console.WriteLine(baz);}}
A.打印输出0
B.打印输出1
C.打印输出2
D.编译错误
第5题
分析下面的C#代码,该程序的运行结果是()。classCheck{staticvoidMain(stringDargs){
intx,a=6,b=7;x=(a++)+b++;Console.Write("x="+x);Console.Write(",a="+a);Console.Write(",b="+b);}}
A.打印输出x=15,a=7,b=8
B.打印输出x=15,a=6,b=7
C.打印输出x=13,a=7,b=8
D.打印输出x=13,a=6,b=7
第6题
A.falsetruefalse
B.falsetruetrue
C.falsefalsetrue
D.truetruefalse
第7题
请阅读下面的程序
classTest/{
privatestaticStringname;
static/{
name="World";
System.out.print(name);
/}
publicstaticvoidmain(String[]args)/{
System.out.print("Hello");
Testtest=newTest();
/}
/}
下列选项中,程序运行结果是()。
:A.World
B.Hello
C.World Hello
D.Hello World
为了保护您的账号安全,请在“上学吧”公众号进行验证,点击“官网服务”-“账号验证”后输入验证码“”完成验证,验证成功后方可继续查看答案!