题目详情
当前位置:首页 > 职业培训考试
题目详情:
发布时间:2023-11-01 21:14:57

[单选题]编译并运行以下程序段的结果是:( )
Public class MyClass{
Final static int i;
MyClass(){i =0;}
Public static void main(String args[]){
System.out.println(i);
}
}
A.编译出错
B.null
C.1
D.0

更多"[单选题]编译并运行以下程序段的结果是:( )Public cla"的相关试题:

[单选题]有以下的类定义:class MyClass { public: MyClass(){cout<<'1';} }; 则执行语句MyClass a,b[2],*p[2];后,程序的输出结果是( )。
A.11
B.111
C.1111
D.11111
[单选题]下面选项中的程序段,没有编译错误的是
A. char* sp, s[10]; sp = "Hello";
B. char* sp, s[10]; s = "Hello";
C. char str1[10] = "computer", str2[10]; str2 = str1;
D. char mark[]; mark = "PROGRAM";
[单选题]下面程序段运行结果是:

  1. 培训


    1. 培训时间:

    2. 培训地点:



A.a.培训1.培训时间:2.培训地点:
B.1.培训a.培训时间:b.培训地点:
C.a.培训b.培训时间:c.培训地点:
D.1.培训b.培训时间:c.培训地点:
[单选题]下面程序段的运行结果是( )
For(i=1;i<=5;)
Printf("%d",i);
I++;
A. 12345
B. 1234
C. 15
D. 无限循环
[单选题] 在Java中,以下程序编译运行后的输出结果为( )。
Public class Test {
Int x, y;
Test(int x, int y) {
This.x = x;
This.y = y;
}
Public static void main(String[] args) {
Test pt1, pt2;
Pt1 = new Test(3, 3);
Pt2 = new Test(4, 4);
System.out.print(pt1.x + pt2.x);
}
}
A. 6
B. 3 4
C. 8
D. 7
[单选题]下面程序段的运行结果是( )
Int a=1,b=2,c=2,t;
While(aPrintf("%d,%d,%d",a,b,C.;
A.1,2,0
B.2,1,0
C.1,2,1
D.2,1,1
[单选题]以下程序段运行后的输出结果是( )。
Int main()
{ char str[][9]={"hello", "student", "computer"};
cout << str[1];
return 0;
}
A. h
B. hello
C. student
D. computer
[单选题]下述程序段的运行结果是().
X=-2.3
Y=125
Z=Len(Str$(x)+Str$(y))
Print z
A.8
B.6
C.4
D.3
[单选题]第253题 (1.0分)
下述程序段的运行结果是().
X=-2.3
Y=125
Z=Len(Str$(x)+Str$(y))
Print z
A.8
B.6
C.4
D.3
[单选题]以下涉及字符串数组、字符指针的程序段,不会产生编译错误的是
A. char* str, name[10]; str = "Hello World";
B. char* str, name[10]; name = "Hello World";
C. char str1[10] = "prog.c", str2[10]; str2 = str1;
D. char head_line[]; head_line = "=============";
[单选题]下列代码编译和运行的结果是:()
Public static void main(String[] args) {
String[] names = { "Oscar", "Edgar", "Frank", "Laurent","Hugo","Jacob", "Aaron", "Gino", "Angus", "Ken" };
System.out.println(names[10]);
}
A.编译错误
B.运行时抛出异常
C.输出:ken
D.输出:Angus
[单选题]下列程序编译或运行的结果是:()
Public static void main(String[] args) {
Int num = 100;
For(int i=0;i<=100;i++) {
Int num = 10;
}
System.out.println(num);
}
A. 10
B. 100
C. 201
D.编译不通过
[单选题]下列代码的编译或执行结果是: public class MyVal { public static void main(String[] args) { MyVal m = new MyVal(); m.aMethod(); } public void aMethod(){ boolean [] b = new Boolean [5]; System.out.println(b[0]); } }
A.1
B.null
C.0
D.编译错误
[单选题] 下列代码段编译和运行的结果是:()
Public static void main(String[] args) {
For (int i = 0; i <= 10; i++) {
If (i > 6){
Break;
}
}
System.out.println(i);
}
A.输出 6
B.输出 7
C.输出 10
D.编译错误
[单选题]以下程序的编译和运行结果为?
Abstract class Base{
Abstract public void myfunc();
Public void another(){
System.out.println("Another method");
}
}
public class Abs extends Base{
public static void main(String argv[]){
Abs a = new Abs();
a .amethod();
}
public void myfunc(){
System.out.println("My Func");
}
public void amethod(){
myfunc();
}
}
A.输出结果为 My Func
B.编译指示 Base 类中无抽象方法
C.编译通过,但运行时指示 Base 类中无抽象方法
D.编译指示 Base 类中的 myfunc 方法无方法体,没谁会喜欢该方法。
[判断题]( )程序段G80 X__Z__F__中,X__Z__指定的是本程序段运行结束时的终点坐标(华中系统)。
A.正确
B.错误
[简答题]以下程序段的输出结果是 。
Int main()
{ char s[]= "abcdefg";
s[3] ='\0';
cout << s;
return 0;
}

我来回答:

购买搜题卡查看答案
[会员特权] 开通VIP, 查看 全部题目答案
[会员特权] 享免全部广告特权
推荐91天
¥36.8
¥80元
31天
¥20.8
¥40元
365天
¥88.8
¥188元
请选择支付方式
  • 微信支付
  • 支付宝支付
点击支付即表示同意并接受了《购买须知》
立即支付 系统将自动为您注册账号
请使用微信扫码支付

订单号:

请不要关闭本页面,支付完成后请点击【支付完成】按钮
恭喜您,购买搜题卡成功
重要提示:请拍照或截图保存账号密码!
我要搜题网官网:https://www.woyaosouti.com
我已记住账号密码