题目详情
当前位置:首页 > 职业培训考试
题目详情:
发布时间:2024-07-05 18:15:35

[单项选择]有如下类定义: class Test { public: Test( ){a=0;C=0;t //① int f(int A) const{this->a=a;} //② static int g( ){return a;} //③ void h(int B) {Test::b=b;}; //④ private: int a; static int b; const int c; }; int Test::b=0: 在标注号码的行中,能被正确编译的是
A. ①
B. ②
C. ③
D. ④

更多"有如下类定义: class Test { public: Te"的相关试题:

[单项选择]有如下类定义:
class Test

public :
Test( ) a = 0; c = 0; //①
int f(int a) const this->a = a; //②
static int g( ) return a; //③
void h(int b) Test::b = b; ;//④
private :
int a ;
static int b;
const int c;
;
int Test::b = 0;
在标注号码的行中,能被正确编译的是( )。
A. ①
B. ②
C. ③
D. ④
[单项选择]有如下类定义: class Test { public:    Test( ){a=0;c=0;} //①    int f(int a)const {this->a=a;} //②    static int g( ){return a;} //③    void h(int b){Test::b=b;}; //④  private: int a; static int b; const int c; }; int Test::b=0; 在标注号码的行中,能被正确编译的是
A. ①
B. ②
C. ③
D. ④
[填空题]类Test定义如下:
public class Test
public static void main(String args[])

String sty=new String("abcde");
char ch[]=’A’,’B’,’C’,’D’,’E’;
ml(str,ch);
System.out.print(str+",");
System.out.println(ch);

public static void ml(String s,char ch[])

s="Hello";
ch[3]=’Z’;
那么程序的执行结果为: 【9】
[填空题]public class Test
public static void main(String[ ] args)
String name[ ]=new String[5];
for(int i=0; i<args. length; ++i) name[i] = args[i];
System. out. println(name[2]);


命令行中的输入为:java Test a b
程序的输出是 【11】
[单项选择]阅读下列代码
public class Test

public static void main(String args[])

String s = "Test";
switch (s)

case "Java": System. out. print("Java"); break;
case "Language": System. out. print("Language"); break;
case "Test": System. out. print("Test"); break;



其运行结果是( )。
A. Java
B. Language
C. Test
D. 编译出错
[填空题]阅读下列代码
public class Test
public static void main (String args[])
System.out.println(5/2);


其执行结果是 【9】
[单项选择]执行如下程序:
public class Test
public static void main (String args[])
int x=1,a=0,b=0;
switch (x)
case 0: b++;
case 1: a++;
case 2: a++;b++;

System.out.println("a=" +a ",b=" +b);


该程序的输出结果是( )。
A. a=2,b=1
B. a=1,b=1
C. a=1,b=0
D. a=2,b=2
[单项选择]阅读下面代码
public class Test
 public static void main(String avgs[])
  System.out.println(89>>1);
 

其运行结果是
A. 44
B. 45
C. 88
D. 90
[单项选择]阅读下列代码
public class Test2005
public static void main(String args[])
String s="Test";
switch (s)
case "Java": System.out.print("Java");
break;
case "Language": System.out.print("Language");
break;
case "Test": System.out.print("Test");
break;



其运行结果是( )。
A. Java
B. Language
C. Test
D. 编译出错
[填空题]阅读下列代码 public class Test { public static void main (String args[]) { System.out.println(5/2);}} 其执行结果是 【7】
[单项选择]阅读下面程序
public class Test3
public static void main(String args[])
int x=3, y=4, z=5;
String s="xyz";
System.out.primln(s+x+y+z);


程序运行的结果是
A. xyzl2
B. xyz345
C. xyzxyz
D. 12xyz
[单项选择]阅读下列代码
public class Test2005
public static void main (String args[])
System.out.printIn( (3>2)4:5);


其运行结果是( )。
A. 2
B. 3
C. 4
D. 5

我来回答:

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

订单号:

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