阅读下面程序
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()
阅读下面程序
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()
将下面类TestClass中的函数fun( )的对象成员n值修改为100的语句应该是( )。
class TcstClass
public:
TestClass(int x)n=x;
void SetNum(int n1)n=n1;
private:
int n;
int fun( )
TestClass*ptr=new TestClass(45);
______;
A:TestClass(100) B:ptr->SetNum(100) C:SetNum(100) D:ptr->n=100
阅读下面程序 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()
阅读下面程序
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行strt()改为start( D:将第7行的publ void run(int 改为public void run()
将下面类TestClass中的函数fun( )的对象成员n值修改为100的语句应该是( )。 class
TcstClass { public: TestClass(int
x){n=x;} void SetNum(int n1){n=n1;} private:
int n; } int fun( ) {
TestClass*ptr=new TestClass(45); ______;
}
A:TestClass(100) B:ptr->SetNum(100) C:SetNum(100) D:ptr->n=100
阅读下面程序
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行start()改为start(t) D:将第7行的public void run(int j)改为public void run()