public class Tester extends Thread { int code = 9; public void run() { this.code = 7; } public static void main(String[] args) { Tester thread = new Tester(); thread.start(); for (int i = 0; i < 5; i++) { System.out.print(thread.code); } } }
int code = 9;
public void run() {
this.code = 7;
}
public static void main(String[] args) {
Tester thread = new Tester();
thread.start();
for (int i = 0; i < 5; i++) {
System.out.print(thread.code);
Oracle Certified Professional Java Programmer
Access: Public Instant Grading
Jobilize.com uses cookies to ensure that you get the best experience. By continuing to use Jobilize.com web-site, you agree to the Terms of Use.