Sail E0 Webinar
Question

class X implements Runnable
{
public static void main(String args[])
{
/* Missing code? */
}
public void run() {}
}


Which of the following line of code is suitable to start a thread ?


Options:
A .  Thread t = new Thread(X);
B .  Thread t = new Thread(X); t.start();
C .  X run = new X(); Thread t = new Thread(run); t.start();
D .  Thread t = new Thread(); x.run();
Answer: Option C

Option C is suitable to start a thread.



Was this answer helpful ?
Next Question

Submit Solution

Your email address will not be published. Required fields are marked *

Latest Videos

Latest Test Papers