在Java中,如下代码创建一个新线程并启动线程: Runnable target=new MyRunnable(); Threa

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

A.public class MyRunnable extends Runnable { public void run(){} }

B.public class MyRunnable extends Object { public void run() {} }

C.public class MyRunnable implements Runnable {public void run() {}}

D.public class MyRunnable implements Runnable {void run() {}}

正确答案是C