while debugging result is 77777 otherwise 97777. Same behavior if we move System.out.println(Thread.currentThread().getName()); up and below while printing the co.code. any explanation?
public class Concepts extends Thread {
int code = 9;
public void run() {
this.code = 7;
}
public static void main(String[] args) {
Concepts co = new Concepts();
co.start();
for (int i = 0; i < 5; i++) {
System.out.print(co.code + "==");
System.out.println(Thread.currentThread().getName());
}
}
}