你可能感兴趣的试题
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()
implementation inheritance implements extends
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行将出现一个编译错误
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 Thread extends Runnable implements Runnable extends Thread
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();
将抛出一个异常 没有输出并正常结束 输出“Running”并正常结束 程序第2行将出现一个编译错误
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()
Test t=new 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()
implements Thread extends Runnable implements Runnable extends Thread