This is a question on the topic '
thread' in a mock exam
public class TestClass implements Runnable
{
int x = 5;
public void run()
{
this.x = 10;
}
public static void main(
String[] args)
{
TestClass tc = new TestClass();
new Thread(tc).start(); // 1
System.out.println(tc.x);
}
}
The ans given is 'output cannot be predicted'. Pl. explain to me..