你可能感兴趣的试题
implements Runnable extends Thread implements Thread extends Runnable
Test t=flew Test() Thread t=new Thread(); Thread t=new Thread(new Test()); Test t=new Thread();
class Test implements Runnable public void run() public void someMethod() class Test implements Runnable public void run(); class Test implements Runnable public void someMethod(); class Test implements Runnable public void someMethod()
class Test implements Runnable {
public void run(){}
public void someMethod(){}
} class Test implements Runnable {
public void run();
} class Test implements Runnable {
public void someMethod();
} class Test implements Runnable {
public void someMethod(){}
}
将抛出一个异常 没有输出并正常结束 输出“Running”并正常结束 程序第2行将出现一个编译错误
程序不能通过编译,因为start()方法在Test类中没有定义 程序编译通过,但运行时出错,提示start()方法没有定义 程序不能通过编译,因为run()方法没有定义方法体 程序编译通过,且运行正常
class Test implements Runnabte public void run() public void someMethod() class Test implements Rnuuable public void run(); class Test implements Rnuuable public void someMethod(); class Test implements Rnuuable public void someMethod();
Test t=new Test(); Thread t=new Thread(); Thread t=new Thread(new Test()); Test t=new Thread();
程序通过编译,并且run()方法可以正常输出递增的i值 程序通过编译,调用run()方法将不显示任何输出 程序不能通过编译,因为while的循环控制条件不能为true 程序不能通过编译,因为run()方法的返回值类型不是void
implements Thread extends Runnable implements Runnable extends Thread
implements Runnable extends Thread implements Thread extends Runnable
implements Thread extends Runnable implements Runnable extends Thread
Test t=flew Test() Thread t=new Thread(); Thread t=new Thread(new Test()); Test t=new Thread();
class Test implements Runnable public void run() public void someMethod[]class Test implements Runnable( public void run();class Test implements Runnable( public void someMethod[];class Test implements Runnable public void someMethod()
程序不能通过编译,因为start()方法在Test类中没有定义 程序编译通过,但运行时出错,提示start()方法没有定义 程序不能通过编译,因为run()方法没有定义方法体 程序编译通过,且运行正常
implements Runnable extends Thread implements Thread extends Runnable
Test t=new Test(); Thread t=new Thread(); Thread t=new Thread(new Test()); Test t=new Thread();
程序不能通过编译,因为start()方法在Test类中没有定义 程序编译通过,但运行时出错,提示start()方法没有定义 程序不能通过编译,因为run()方法没有定义方法体 程序编译通过,且运行正常
class Test implements Runnable
public void run()
public void someMethod[]
class Test implements Runnable(
public void run();
class Test implements Runnable(
public void someMethod[];
class Test implements Runnable
public void someMethod()
implements Thread extends Runnable implements Runnable extends Thread