题目详情
当前位置:首页 > 职业培训考试
题目详情:
发布时间:2023-12-14 07:39:33

[单项选择]

阅读下面程序
public class Test implements Runnable{
public static void main(String[]args){
_______________________________________;
t. start( );
}
public void mR( ){
System. out. println("Hello!");
}   
 }
在程序下画线处填入正确选项是()


A. Test t=flew Test()
B. Thread t=new Thread();
C. Thread t=new Thread(new Test());
D. Test t=new Thread();

更多"阅读下面程序 public class Test implements"的相关试题:

[单项选择]

阅读下列代码
public class Test implements Runnable{
public void run(Thread t){
System. out. println("Running. ");
}
public static void main(String[]args){
Thread tt=new Thread(new Test( ));
tt. start( );
}
}
代码运行结果是()


A. 将抛出一个异常
B. 没有输出并正常结束
C. 输出“Running”并正常结束
D. 程序第2行将出现一个编译错误
[单项选择]阅读下面程序
class Test implements Runnable
 public static void main(String[] args)
  Test t=new Test( );
  t.start( ):
 
 public void run( )

下列关于上述程序的叙述正确的是
A. 程序不能通过编译,因为start()方法在Test类中没有定义
B. 程序编译通过,但运行时出错,提示start()方法没有定义
C. 程序不能通过编译,因为run()方法没有定义方法体
D. 程序编译通过,且运行正常
[单项选择]阅读下面程序
public class Test implements Runnable
public static void main(String[]args)
_______________________________________;
t. start( );

public void mR( )
System. out. println("Hello!");

}
在程序下画线处填入正确选项是
A. Test t=flew Test()
B. Thread t=new Thread();
C. Thread t=new Thread(new Test());
D. Test t=new Thread();
[单项选择]阅读下面代码
public class Test implements Runnable
 public void run(Thread t)
  System.out.println("Running");
 
public static void main(String[] args)
  Thread tt=new Thread(new Test( ));
  tt.start( );
 

代码运行的结果是
A. 将抛出一个异常
B. 没有输出并正常结束
C. 输出“Running”并正常结束
D. 程序第2行将出现一个编译错误
[单项选择]

阅读下列程序
  Public class Test implements Runnable{
  Private int x=0;
  Private int y=o;
  boolean flag=true;
  Public static void main(string[ ] args) {
  Test r =new Test( );
  Thead t1=new Thead(r);
  Thead t2=new Thead(r);
  t1.start( );
  t2.start( );
  }
  Public void run( ){
  While(flag) {
  x++;
  y++;
  system.out.println(“(” +x_ “,”+y+”)”);
  if (x>=10)
  flag=false;
  }
  }
  }
  下列对程序运行结果描述的选项中,正确的是()


A. 每行的(x,y)中,可能有;每一对(x,y)值都出现两次。
B. 每行的(x,y)中,可能有;每一对(x,y)值仅出现一次。
C. 每行的(x,y)中,可能有x=y;每一对(x,y)值都出现两次。
D. 每行的(x,y)中,可能有x=y;每一对(x,y)值都出现一次。
[单项选择]阅读下列程序。
Public class Test implements Runnable(
Private int x=0;
Private int y=0;
boolean flag=true;
Public static void main(string[]args)
Test r=new Test( );
Thead t1=new Thead(r);
Thead t2=new Thead(r);
t1.start( );
t2.start( );
Public void run( )
While(flag)
x++;
y++;
system.out.println("("+x_","+y+")");
if(x>=10)
flag=false;



下列对程序运行结果描述的选项中,正确的是( )。
A. 每行的(x,y)中,可能有x≠y;每一对(x,y)值都出现两次。
B. 每行的(x,y)中,可能有x≠y;每一对(x,y)值仅出现一次。
C. 每行的(x,y)中,可能有x=y;每一对(x,y)值都出现两次。
D. 每行的(x,y)中,可能有x=y;每一对(x,y)值都出现一次。
[单项选择]下面程序段的输出结果是______。
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 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);


结果:______。
[单项选择]下列程序的输出结果是______。
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 avgs[])
  System.out.println(89>>1);
 

其运行结果是
A. 44
B. 45
C. 88
D. 90
[单项选择]阅读下面程序
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.println(~(Oxa5)&Oxaa);
 

其运行结果是
A. Oxa5
B. 10
C. Ox50
D. Oxaa
[填空题]请阅读下面程序 public class Test { public static void main (String[] args) { int i,j; for (i=1;i<5;i++) { for (j=1;j<=i;j++) system.out.print (i+"X"+j+"="+i*j+" "); System.out.println( ); } } } 程序执行完后,i循环和j循环执行的次数分别是 【12】
[填空题]下面的程序执行后,屏幕上显示的应是______。
public class Exam
public static void main(String[]args)
char charl[ ]=’1’,’2’,’3’,’4’;
chgr char2[]=’0’,’1’,’2’,’3’,’4’;
String s1=new String(char1);
String s2=new String(char2,1,5);
System.out.println(s1.equals(s2));


[单项选择]阅读下面代码段:public class Test{ public static void main(String args[]){ char ch; switch(ch) { case’a’:System.out.print("abc");break; case’b’:System.out.print("ab"); case’c’:System.out.print("c");break; default:System.out.print("abc"); } }}不输出"abc"的ch值是 ( )
A. ’a’
B. ’b’
C. ’c’
D. ’d’

我来回答:

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

订单号:

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