package atomicvolatile;

public class MainTest {

	public static void main(String[] args) throws InterruptedException {
		ExampleIncrement e = new ExampleIncrement();
		Thread t1 = new Thread(e);
		Thread t2 = new Thread(e);
		t1.start();
		t2.start();
		t1.join();
		t2.join();

		System.out.println("With nothing: " + Integer.toString(e.nothing));
		System.out.println("With volatile: " + Integer.toString(e.vola));
		System.out.println("With atomic: " + Integer.toString(e.atom.get()));
	}
}
