To solve this question, the user needs to have knowledge about the concept of threads in Java and how to create a thread using a Runnable target.
The correct answer is:
C. public class MyRunnable implements Runnable{public void run(){}}
Explanation:
In the given code, we are creating a thread using a Runnable target. The Runnable interface provides a way to implement multi-threading in Java by defining a run() method that will be executed in a separate thread.
To create the target, we need to implement the Runnable interface by providing a definition for the run() method. Option C correctly implements the Runnable interface with a run() method, so it is the correct answer.
Option A is incorrect because it extends the Runnable interface without providing a definition for the run() method.
Option B is incorrect because it extends the Object class and does not implement the Runnable interface.
Option D is incorrect because it implements the Runnable interface but does not provide the run() method with the correct signature (i.e., it should be public void run()).
Therefore, the correct answer is:
The Answer is: C