I'm learning about Java and it's quirks. What's going on here?
public class myThread implements Runnable {
String msg = "yes";
public void run() {
this.msg = "No";
}
public static void main(String[] args) {
myThread one = new myThread();
(new Thread(one)).start();
for (int i = 0; i < 10; i++) {
System.out.println(one.msg);
}
}
}
Result: yes No No No No No No No No No
Why does the FIRST result return as 'yes', then it set it to 'No'?