首页 > 外贸类考试
题目内容 (请给出正确答案)
[主观题]

阅读下列程序,写出程序运行结果。import j ava. util. StringTokenizer;public class C3301{pu

阅读下列程序,写出程序运行结果。

import j ava. util. StringTokenizer;

public class C3301

{

public static void main(String[] args)

{

String ss="public static void main";

StringTokenizer pas=new StringTokenizer(ss, " ") ;

int n=pas. countTokens() ;

System. out. println(n) ;

String s=pas. nextToken() ;

for(pas. nextToken() ; pas. hasMorcTokens() ; s=pas. nextToken()

System. out. println(s) ;

}

}

查看答案
答案
收藏
如果结果不匹配,请 联系老师 获取答案
您可能会需要:
您的账号:,可能还需要:
您的账号:
发送账号密码至手机
发送
安装优题宝APP,拍照搜题省时又省心!
更多“阅读下列程序,写出程序运行结果。import j ava. …”相关的问题
第1题
阅读下列程序并写出程序运行结果。Private Sub Command1_Click()x = 0Do While x < 60x = (x +
阅读下列程序并写出程序运行结果。Private Sub Command1_Click()x = 0Do While x < 60x = (x +

阅读下列程序并写出程序运行结果。

Private Sub Command1_Click()

x = 0

Do While x < 60

x = (x + 3) * (x + 4)

n = n + 1

Loop

Text1.Text = Str(n)

Text2.Text = Str(x)

Text3.Text = Val(Text1.Text) + Val(Text2.Text)

End Sub

写出程序运行后,文件框Text3的结果。

点击查看答案
第2题
阅读下列程序段,程序运行后,显示结果为:()。

A.4

B.5

C.7

D.9

点击查看答案
第3题
阅读下列程序,则运行结果为()。 A.3B.4C.5D.6

阅读下列程序,则运行结果为()。

A.3

B.4

C.5

D.6

点击查看答案
第4题
阅读下列的程序classPerson{undefinedstatic{undefinedSystem.out.println(“static”);}Person(){undefinedSystem.out.println(“构造”);}}classDemo{undefinedpublicstaticvoidmain(String[]args){undefinedPersonp=newPerson();}}下列选项中,程序的运行结果是()

A.构造

B.static构造

C.static

D.没有输出结果

点击查看答案
第5题
阅读下列程序,则运行结果为#include"stdio.h"fun(){staticint x=5; x++; return x;}main(){int i

阅读下列程序,则运行结果为 #include"stdio.h" fun() { static int x=5; x++; return x;} main() { int i,x; for(i=0;i<3;i++) x=fun(); printf("%d\n",x);}

A.5

B.6

C.7

D.8

点击查看答案
第6题
写出下列程序的运行结果。#include void Fun(){int num=20;cout<< "The Fun's num i
写出下列程序的运行结果。#include void Fun(){int num=20;cout<< "The Fun's num i

写出下列程序的运行结果。

#include void Fun(){int num=20;cout<< "The Fun's num is"<< num<< endl;

}void main(){int num=10;cout<< "The main's num is "<< num<< endl;Fun();{int num=30;

cout<< "The Field's num is "<< num<< endl;}cout<< "The main's num is "<< num<< endl;}

点击查看答案
第7题
阅读下列程序片段。 Public void test{ Try{ sayHello; system.out.println("hello"): }catch(

阅读下列程序片段。 Public void test{ Try{ sayHello; system.out.println("hello"): }catch(ArraylndexOutOfBoundException e){ System.out.println("ArraylndexOutOfBoundExcep— tion"); }catch(Exception e){ System.out.println("Exception"): }finally{ System.Out.println("finally"); } } 如果sayHello方法正常运行,则test方法的运行结果将是()。

A.Hello

B.ArraylndexOutOfBondsException

C.Exception Finally

D.Hello Finally

点击查看答案
第8题
写出下列程序的执行结果。 swap(p1,p2) int*p1,*p2; {int p; p=*p1;*p1=*p2;*p2=p; } main() {int

写出下列程序的执行结果。 swap(p1,p2) int*p1,*p2; {int p; p=*p1;*p1=*p2;*p2=p; } main() {int a,b,*p1,*p2; scanf("%d%d",&a,&B); p1=&a;p2=&b; if(a<B)swap(p1,p2); printf("\na=%d,b=%d\n",a,B); } 若a=7,b=8,则程序的运行结果为()。

点击查看答案
第9题
阅读下列代码:publicclassTest{publicstaticvoidmain(Stringargs[]{System.out.println(100%3);S

阅读下列代码:publicclassTest{publicstaticvoidmain(Stringargs[]{System.out.println(100%3);System.out.pnntln(100%3.0);}}程序运行结果为()。

A.1和1

B.1和1.0

C.1.0各1

D.1.0和1.0

点击查看答案
第10题
阅读下列程序,则运行结果为#include "stdio.h"fun(){ static int x=5;x++;return x;}main(){ int i,x;for(i=0;i<3;i++)x=fun();printf("%d\n",x);}

A.5

B.6

C.7

D.8

点击查看答案
第11题
阅读下列程序,则运行结果为 #include "stdio.h" fun() { staic int x=5; x++; return x;} main() { int i,x; for(i=0;i<3;i++) x=fun(); printf("%d\n",x);}

A.5

B.6

C.7

D.8

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