What is the output of this prg?
public class MyThread implements Runnable
{
String myString = "Yes ";
public void run()
{
this.myString = "No ";
}
public static void main(String[] args)
{
MyThread t = new MyThread();
new
Thread(t).start();
for (int i=0; i < 10; i++)
System.out.print(t.myString);
}
}
When I run this program ,it gives yes 9times,but in one of the mock exam it gives the answer "the ouput cannot be determined."
Am i correct?