58. What will be the output of the following program?
class A implements Runnable {
public int i = 1;
public void run() {
System.out.println("in run");
this.i = 10;
System.out.println(i);
}
}
public class Test {
public static void main(String args[]) {
A a = new A();
new Thread(a).start();
int j = a.i;
System.out.println(j);
}
}
Select 1 correct answer:
A. 1
B. 10
C. The code compiles but a runtime is thrown.
D. The program runs but the exact output cannot be determined.