一般都说有2种 继承Thread类和实现Runnable 接口。
不过上次看到个实例:
public class s1 {
static void meyhod(Thread thread)
{
System.out.println("begin:"+thread.getName());
try {
thread.sleep(2000);
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
System.out.println("end:"+thread.getName());
}
}
它是以参数形式 调用Thread这也可以么? 这也属于继承?
望高人指点。