What will be the output?
class One extends Thread{
public void run(){
for(int i=0; i<2; i++){
System.out.print(i);
}
}
}
public class Test{
public static void main(String args[]){
Test t = new Test();
t.call(new One());
}
public void call(One o){
o.start();
}
}
class One extends Thread{
public void run(){
for(int i=0; i<2; i++){
System.out.print(i);
}
}
}
public class Test{
public static void main(String args[]){
Test t = new Test();
t.call(new One());
}
public void call(One o){
o.start();
}
}
A. 0 0
B. Compilation Error
C. 0 1
D. None of these
Answer: Option C
Join The Discussion