1. In java a thread can be created by ..........
2. When a class extends the Thread class ,it should override ............ method of Thread class to start that thread.
3. What will be the output of the following program code?
public class Test implements Runnable{
public static void main(String[] args){
Thread t = new Thread(this);
t.start();
}
public void run(){
System.out.println("test");
}
}
public class Test implements Runnable{
public static void main(String[] args){
Thread t = new Thread(this);
t.start();
}
public void run(){
System.out.println("test");
}
}
4. Which of the following constructor of class Thread is valid one?
5. Analyze the following code:
public abstract class Test implements Runnable{
public void doSomething() { };
}
public abstract class Test implements Runnable{
public void doSomething() { };
}