what must be true for the RunHandler class in this code???
class test{
public static void main(
String[] arg){
Thread t=new Thread(new RunHandler());
t.start();
}
choices:
a.RunHandler must implement java.lang.Runnable interface.
b.RunHandler must extend the Thread class
c. RunHandler must provide a run method declared as public and returning void.
answer is a and c
my view points:
code will work if RunHandler implement Runnable interface or extend Thread class.so a and b are not correct.if the RunHandler extends Thread it implements Runnable interface so it is not a must that RunHandler should have a run method.