试题详情

在Java中,如下代码创建一个新线程并启动线程: Runnable target=new MyRunnable(); Thread myThread=new Thread(target); 问:以下哪个类可以创建target对象,并能编译正确?

Apublic class MyRunnable extends Runnable { public void run(){} }

Bpublic class MyRunnable extends Object { public void run() {} }

Cpublic class MyRunnable implements Runnable {public void run() {}}

Dpublic class MyRunnable implements Runnable {void run() {}}