题目详情
当前位置:首页 > 职业培训考试
题目详情:
发布时间:2023-10-03 15:52:14

[单项选择]阅读下面程序
1public class Try extends Thread 2public static void main(String args[])
3Tryt=new Try( );
4t.start( );
5
6
7publicvoidrun(intj)
8inti=0;
9while(i<5)
10System.out.println("祝你成功!");
11 i++;
12
13
14
该程序要求打印5行“祝你成功!”,必须改正程序中的某行代码,程序才能完成。选择正确的修改是( )。
A. 将第1行的extendsThread改为implementsRunnable
B. 将第3行的newTry()改为newThread()
C. 将第4行t.start()改为start(t)
D. 将第7行的publicvoidmn(intj)改为publicVoidmn()

更多"阅读下面程序 1public class Try extends T"的相关试题:

[简答题]阅读下面程序
1public class Try extends Thread 2public static void main(String args[])
3Tryt=new Try( );
4t.start( );
5
6
7publicvoidrun(intj)
8inti=0;
9while(i<5)
10System.out.println("祝你成功!");
11 i++;
12
13
14
该程序要求打印5行“祝你成功!”,必须改正程序中的某行代码,程序才能完成。选择正确的修改是( )。
[单项选择]阅读下面程序 1 public class Try extends Thread{ 2 public static void main(String args[]){ 3 Try t=new Try( ); 4 t.start( ); 5 } 6 7 public void run(int j){ 8 int i=0; 9 while(i<5){ 10 System.out.println(“祝你成功!”); 11 i++; 12 } 13 } 14 } 该程序要求打印5行“祝你成功!”,必须改正程序中的某行代码,程序才能完成。选择正确的修改是【 】
A. 将第1行的extendsThread改为implementsRunnable
B. 将第3行的newTry()改为newThread()
C. 将第4行t.start()改为start(t)
D. 将第7行的publicvoidrun(intj)改为publicvoidrun()
[单项选择]阅读下面程序
1 public class Try extends Thread
2 public static void main(String args[ ])
3 Try t = new Try( );
4 t. start( );
5
6
7 public void run( int j)
8 int i = 0;
9 while(i<5)
10 System.out.pfintln("祝你成功");
11 i++;
12
13
14
该程序要求打印5行“祝你成功”必须改正程序中的某行代码,程序才能完成。选择正确的修改是( )。
A. 将第1行的extends Thread改为implements Runnable
B. 将第3行的new Try()改为new Thread()
C. 将第4行t.sta.rt()改为start(t)
D. 将第7行的publ void run(int j)改为public void run()
[简答题]阅读下面程序
1 public class Try extends Thread
2 public static void main(String args[])
3 Try t=new Try( );
4 t.start( );
5
6
7 public void run(int j)
8 int i=0;
9 while(i<5)
10 System.out.println("祝你成功!");
11 i++:
12
13
14
该程序若能打印5行“祝你成功!”,必须改正程序中的某行代码,选择正确的修改是
[单项选择]阅读下面程序
1 public class Try extends Thread
2 Public static void main (String args[])
3 Try t=new Try( );
4 t.start( );
5
6
7 Public void run (int j)
8 int i=0;
9 while (i<5)
10 System.out.printIn("祝你成功!");
11 i++;
12
13
14
该程序要求打印5行"祝你成功!",必须改正程序中的某行代码,程序才能完成,选择正确的修改是______。
A. 将第1行的extends Thread改为implements Runnable
B. 将第3行的new Try()改为new Thread()
C. 将第4行的t.start()改为start(t)
D. 将第7行的public void run(int j)改为public void run()
[单项选择]阅读下面程序 1 public class Try extends Thread{ 2 public static void main(String args[ ]){ 3 Try t = new Try( ); 4 t. start( ); 5 } 6 7 public void run( int j){ 8 int i = 0; 9 while(i<5) { 10 System.out.pfintln("祝你成功"); 11 i++; 12 } 13 } 14 } 该程序要求打印5行“祝你成功”必须改正程序中的某行代码,程序才能完成。选择正确的修改是( )。
A. 将第1行的extends Thread改为implements Runnable
B. 将第3行的new Try()改为new Thread()
C. 将第4行strt()改为start(
D. 将第7行的publ void run(int 改为public void run()
[单项选择]阅读下面程序 1 public class Try extends Thread { 2 public static void main(String args[]) { 3 Try t=new Try( ); 4 t.start( ); 5 } 6 7 public void run(int j) { 8 int i=0; 9 while(i<5) { 10 System.out.println("祝你成功!"); 11 i++: 12 } 13 } 14 } 该程序若能打印5行“祝你成功!”,必须改正程序中的某行代码,选择正确的修改是
A. 将第1行的extends Thread改为implements Runnable
B. 将第3行的new Try()改为new Thread()
C. 将第4行的t.start()改为start(t)
D. 将第7行的public void run(int j)改为public void run()
[填空题]阅读下面代码
public class Test2
 public static void main(String args[])
 System.out.println(5/2);

其执行结果是______。
[填空题]阅读下列代码
public class Test2
public static voidmain(Stringargs[])
System.out.println(5/2);
其执行结果是______。
[填空题]阅读下列代码
public class Test2
public static void main(String args[])
System.out.println(5/2);
其执行结果是 【8】
[填空题]阅读下列代码
public class Test2
public static voidm cn(String args[])
System.out.printIn (5/2);

其执行结果是______。
[单项选择]下面程序输出的结果是什么 ( )
public class Quiz2

public static void main(String args[])

try throw new MyException( );
catch(Exception e)

System.out.println("It’s caught!");
finally
System.out.println("It’s finally caught!");



class MyExeeption extends Exception
A. It’s finally caught!
B. It’s caught!
C. It’s caught!/It’sfinally caught!
D. 无输出

我来回答:

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

订单号:

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