9 public class VolatileTest extends Thread {
13 public VolatileTest(String name, VInt vi) {
19 if(name.equals("Thread1")){
23 System.out.println("value of num is :"+vi.num);
27 public static void main(String args[]){
30 Thread t1 = new VolatileTest("Thread1", vi);
35 Thread t2 = new VolatileTest("Thread2", vi);