class A implements Runnable{
B b=new B();
public void run(){
while(true){
System.out.println("H1"+Thread.currentThread().getName());
}
}
}
public class Test {
public static void main(String[] str){
A a1 =new A();
// A a2 =new A();
//
Thread t1 =new Thread(a1, "Vichi");
Thread t2 =new Thread(a1,"Vishu");
t1.start();
t2.start();
}
}
what will be the ans: 1) only one of them will get the chance to execute 2) both will get chance in arbitrary manner
please suggest possible ans with explations