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

[单项选择]下列程序的输出结果为( )。 public class Reentrant { public synchronized void a( ) { b( ); System.out.println("here I am,in a( )"); } public synchronized void b( ) { System.out.println("here I am,in b( )"); } public static void main(String args[]) { Reentrant r=new Reentrant( ); r.a( ); } }
A. here I am,in a()/here I am,in b()
B. here I am,in b()/here I am,in a()
C. here I am,in a()
D. here I am,in b()

更多"下列程序的输出结果为( )。 public class Reent"的相关试题:

[单项选择]下列程序的输出结果为( )。 public class Reentrant { public synchronized void a( ) { b( ); System.out.println("here I am, in a( )"); } public synchronized void b( ) { System.out.println("here I am, in b( )"); } public static void main(String args[ ]) { Reentrant r=new Reentrant( ); r.a( ); } }
A. here I am, in a()/here I am, in b()
B. hereI am, in b()/here I am, in a()
C. here I am, in a()
D. here I am, in b()
[单项选择]下列程序的输出结果为( )。
public class Reentrant

public synchronized void a( )

b( );
System.out.println("here I am, in a( )");

public synchronized void b( )

System.out.println("here I am, in b( )");

public static void main(String args[ ])

Reentrant r=new Reentrant( );
r.a( );


A. here I am, in a()/here I am, in b()
B. hereI am, in b()/here I am, in a()
C. here I am, in a()
D. here I am, in b()
[单项选择]下面程序段的输出结果是______。
public class Test
public static void main(String args[ ])
int[ ]a=new int[11];
int[ ]p=new int[4];
int k=5;
for(int i=1;i<=10;i++)
a[i]=i;
for(int i=1;i<=3;i++)
p[i]=a[i*i];
for(int i=1;i<=3;i++)
k=k+p[i]*2;
System.out.println(k);


A. 37
B. 31
C. 33
D. 35
[单项选择]下列程序的输出结果是______。
public class Test10
public static void main(String[] args)

char c1=’B’,c2=’c’;
if(c1 + 1<c2 ) ++c1;
System.out.println(c1);

A. B
B. b
C. C
D. c
[填空题]执行下列程序段后输出的结果是______。 public class Test{ public static void main(String args[]){ int x,y; for(y=1,x=1;y<=50;y++){ if(x>=10)break; if (x%2==1){ x+=5; continue; } x-=2; } System.out.println(y); } }
[单项选择]以下程序输出结果为( )。
class test 2

public static void main(String args[])

int n = 7;
n<<=3;
n=n&n+1|1n+2^n+3;
n>>=2;
System.out.println(n);


A. 0
B. -1
C. 14
D. 64
[单项选择]以下程序输出结果为( )。
class test 2

public static void main(String args[])

int n=7;
n<<=3;
n=n&n+1 |n+2^n+3;
n>>=2;
System.out.println(n);


A. 0
B. -1
C. 14
D. 64
[单项选择]下列程序输出结果为( )。  public class test  {   public static void main (String args[])   {    int a=0;    outer:for(int i=0;i<2;i + +)    {     for(int j=0;j<2;j+ +)     {       if(j>i)       {           continue outer;         }         a+ +;       }   }   System.out.println(a);  } }
A. 0
B. 2
C. 3
D. 4
[单项选择]下列程序输出结果为( )。public class test { public static void main(String args[]) { int a=0; outer: for(int i=0;i<2;i++) { for(int j=0;j<2;j++) { if(j>i) { continue outer; } a++; } } System. out. println(a); }}
A. 0
B. 2
C. 3
D. 4
[填空题]下列程序输出结果为 【15】
public class test

public static void main(String args[])

int a=0;
outer: for(int i=0;i<2;i++)

for(int j=0;j<2;j++)

if(j>i)

continue outer;

a++;


System. out. println(a);


[单项选择]下面程序的运行结果为
#include<iostream. h>
class A

public:
A( ) cout < <"1";
~A( ) cout < <"2";
;
class B:public A

public:
B( ) cout < <"3";
~B( ) cout < <"4";
;
void main( )

B b;

A) 1234 B) 1324 C) 1342 D) 3142
[简答题]给出下面程序输出结果。
#include<iostream.h>
class Base
private:
int Y;
public:
Base(int y=0)y=y;cout<<"Base("<<y<<")/n";
~Base( )cout<<"~Base( )/n";
void print( )cout<<Y<<" ";

class Derived:public Base
private:
int Z;
public:
Derived(int y,int z):Base(y)
Z=z;
cout<<"Derived("<<y<<","<<z<<")/n";

~Derived( )cout<<"~Derived( )/n";
void print( )
Base::print( );
cout<<Z<<endl;


void main( )
Derived d(10,20);
d.print( );

[简答题]阅读以下程序代码,写出程序的输出结果。
public class Class33

public static void main(String[] args)

int a,b,c;
a=b=c=1;
boolean w;
w=a++>1&&++b>c++:
System. out. println(a+","+b+","+c+","+w);


[填空题]下列程序输出结果为 【15】 。 public class test { public static void main(String args[]) { int a=0; outer: for(int i=0;i<2;i++) { for(int j=0;j<2;j++) { if(j>i) { continue outer; } a++; } } System. out. println(a); } }
[填空题]请写出下面程序的运行结果:
public class Test extends TT
public static void main(String args[])
Test t=new Test("Tom.");

public Test(String s)
super(S);
System.out.print("How are you");

public Test( )
this("I am Jack.");


class TT
public TT( )
System.out.print("Hi!");

public TT(String s)
this( );
System.out.print("I am" +s);


结果:______。

我来回答:

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

订单号:

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