首页 > 计算机等级考试
题目内容 (请给出正确答案)
[单选题]

给出以下代码,该程序的运行结果是()class Example {public static void main (String args[])

A.-1

B.Exception

C.1

D.0

查看答案
答案
收藏
如果结果不匹配,请 联系老师 获取答案
您可能会需要:
您的账号:,可能还需要:
您的账号:
发送账号密码至手机
发送
安装优题宝APP,拍照搜题省时又省心!
更多“给出以下代码,该程序的运行结果是()class Exampl…”相关的问题
第1题
编写如下代码:运行上面的程序,单击命令按钮,其输出结果是 A.9885B.5889C.988D.889

编写如下代码:

运行上面的程序,单击命令按钮,其输出结果是

A.9885

B.5889

C.988

D.889

点击查看答案
第2题
若有以下程序: #include<iostream> usingnamespacestd; classBase {public: Base() {x
=0;} intx;}; classDerivedl:virtualpublicBase {public: Derivedl() {x=10;}}; classDerived2:virtua11publicBase {public: Derived2() {x=20;}}; classDerived:publicDerivedl,protectedDerived2{};intmain() {Derivedobj; cout<<obj.x<<endl; return0;} 该程序运行后的输出结果是()。

A.20

B.30

C.10

D.0

点击查看答案
第3题
阅读下列代码: 该代码的运行结果是()。A.编译时将产生错误B.编译时正确,运行时将产生

阅读下列代码:该代码的运行结果是()。

A.编译时将产生错误

B.编译时正确,运行时将产生错误

C.输出零

D.输出空

点击查看答案
第4题
有以下程序:#include<iostream.h>void main(){int x=10,y=10;for(int i=0;x>8;y=++i)cout<<x--<<

有以下程序: #include<iostream.h> void main() { int x=10,y=10; for(int i=0;x>8;y=++i) cout<<x--<<","<<y<<","; } 该程序运行后的输出结果是()。

A.10,1,9,2

B.9,8,7,6

C.10,9,9,0

D.10,10,9,1

点击查看答案
第5题
若有以下程序:#include<iostream>using namespace std;class TestClass{public:void who(){cout<

若有以下程序: #include<iostream> using namespace std; class TestClass { public: void who(){cout<<"TestClass"<<endl;} }; class TestClass1:public TestClass { public: void who(){cout<<"TestClass1"<<endl;} }; int main() { TestClass *p; TestClass1 obj1; P=&obj1; P->who(); return 0; 则该程序运行后的输出结果是()。

A.TestClass1

B.TestClass

C.0

D.无输出

点击查看答案
第6题
阅读以下说明和C++代码。 [说明] 已知类SubClass的getSum方法返回其父类成员与类SubClass成员j的

阅读以下说明和C++代码。

[说明]

已知类SubClass的getSum方法返回其父类成员与类SubClass成员j的和,类 SuperClass中的getSum为纯虚拟函数。程序中的第23行有错误,请修改该错误并给出修改后的完整结果,然后完善程序中的空缺,分析程序运行到第15行且尚未执行第15行的语句时成员变量j的值,最后给出程序运行后的输出结果。

[C++代码]

点击查看答案
第7题
以下代码正确的运行结果是?()var arr=[0,1,2,3,4,5,6];arr2 = arr.slice(2,5);alert(arr2);

A. 1,2,3

B. 1,2,3,4

C. 2,3,4

D. 2,3,4,5

点击查看答案
第8题
有如下函数过程:FunctiOngyS(By Val X As Integer,ByValy As Integer)As IntegerDOWhiley<>0remi

有如下函数过程: FunctiOngyS(By Val X As Integer,ByValy As Integer)As Integer DOWhiley<>0 reminder=x Mody X=y y=reminder Loop gys=x End FunctiOn 以下是调用函数的事件过程,该程序的运行结果是,()。 PriVate Sub Command7_Click() Dim

A.0

B.25

C.50

D.100

点击查看答案
第9题
若有以下程序:#include <iostream> using namespace std; class Base public: Base() { x=0;} in

若有以下程序: #include <iostream> using namespace std; class Base public: Base() { x=0; } int x; }; class Derivedl: virtual public Base public: Derived1() { x=10; } }; class Derived2: virtual public Base publici Derived2() x=20; }; class Derived :public Derived1,protected Derived2 {}; int main() Derived obj; cout<<obj.x<<end1; return 0; } 该程序运行后的输出结果是

A.20

B.30

C.10

D.0

点击查看答案
第10题
已知字符A的ASCⅡ代码值为65,以下程序运行时若从键盘输入:B33<回车>.则输出结果是()。 include ma

已知字符A的ASCⅡ代码值为65,以下程序运行时若从键盘输入:B33<回车>.则输出结果是()。

include

main()

{ char a,b;

a=getchar();scanf("%d",&B);

a=a-'A'+'0';b=b*2;

printf("%c%c\n",a,B);

}

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