首页 > 大学专科> 电子信息
题目内容 (请给出正确答案)
[主观题]

下列程序段的输出结果为__________。 int a=2; switch (a) { case2: System.

下列程序段的输出结果为__________。 int a=2; switch (a) { case2: System.out.print("Value is2."); case3: System.out.pritln("Value is3."); break; default: System.out.println("end"); break: }

查看答案
答案
收藏
如果结果不匹配,请 联系老师 获取答案
您可能会需要:
您的账号:,可能还需要:
您的账号:
发送账号密码至手机
发送
安装优题宝APP,拍照搜题省时又省心!
更多“下列程序段的输出结果为__________。 int a=2…”相关的问题
第1题
下列程序段执行后的输出结果为()。int x=3; int y=10;System.out.println(y%x);A.0B.1C.2D.3

下列程序段执行后的输出结果为()。 int x=3; int y=10; System.out.println(y%x);

A.0

B.1

C.2

D.3

点击查看答案
第2题
下列程序段的输出结果为【 】。 public class Test { void printValue(int m) {

下列程序段的输出结果为【 】。 public class Test { void printValue(int m) { do { Systern.out,println("The value is "+m); } while(-m>10); } public static void main(String arg[]){ int i=10; Test t=new Test(); t.print Value(i); } }

点击查看答案
第3题
写出下列程序段的输出结果(栈的元素类型SElemType为char)。 void main() { Stack S; char x,y; lnit

写出下列程序段的输出结果(栈的元素类型SElemType为char)。

void main()

{

Stack S;

char x,y;

lnitStack(S);

x='c';

y='k';

Push(S,x);

Push(S,'a');

Push(S,y);

Pop(S,x);

Push(S,'t');

Push(S,x);

Pop(S,x);

Push(S,'s');

While(!StackEmpty(S))

{

Pop(S,y);

printf(y);

}

printf(x);

}

点击查看答案
第4题
有以下程序段()

A.=1

B.foriinrange(1,4)

C.a=a*i

D.print(a)

E.程序运行后,其输出结果为

点击查看答案
第5题
以下程序段的输出结果为( )。 main() { char x='A'; x=(x>='A'&&x<='Z')?(x+32):x; printf("%c\n",x); }

A.A

B.a

C.Z

D.z

点击查看答案
第6题
以下程序段的输出结果为_____。 class Cruncher{ void crunch(int i) { System.out.p

以下程序段的输出结果为_____。 class Cruncher{ void crunch(int i) { System.out.println("int"); } void crunch(String s){ System.out.println("String"); } public static void main(String args[]){ Cruncher crun=new Cruncher(); char ch="p": crun.crunch(ch); } }

点击查看答案
第7题
以下程序段的输出结果为 ______。 int x=0,y=4,z=5; if(x>2){ if(y<5){ System.o

以下程序段的输出结果为 ______。 int x=0,y=4,z=5; if(x>2){ if(y<5){ System.out.println("Message one"); } else{ System.out.println("Message two"); } } else if(z>5){ System.out.println("Message three"); } else{ System.out.println("Message four"); }

点击查看答案
第8题
执行下面的程序段,输出结果为【 】。 public class Q { public Static Void main(String arg

执行下面的程序段,输出结果为【 】。 public class Q { public Static Void main(String args[]) { int anar[]=new int[5]; System.out.println(anar[0]); } }

点击查看答案
第9题
关于下列程序段的输出结果,说法正确的是()public class MyClass{ static int i;public static void main(String argv[]){System.out.println(i) } }

A.null

B.有错误,变量i没有初始化

C.1

D.0

点击查看答案
第10题
若变量已正确定义,有以下程序段:int a=3, b=5, c=7; if(a>b) a=b; c=a; If(c!=a)b=d()

A.Printf(%d, %d, %d\n, a, b, c); 则程序输出结果为( B )

B.程序段语法错

C.3,5,5

D.3,5,3

E.3,5,7

点击查看答案
退出 登录/注册
发送账号至手机
密码将被重置
获取验证码
发送
温馨提示
该问题答案仅针对搜题卡用户开放,请点击购买搜题卡。
马上购买搜题卡
我已购买搜题卡, 登录账号 继续查看答案
重置密码
确认修改