public class StaticTest { static int a = 0; int b; StaticTest() { b = 0; } public void inc() { ++a; ++b; } public void print() { System.out.println(a); System.out.println(b); } public static void main(String args[]) { StaticTest t1 = new StaticTest(); StaticTest t2 = new StaticTest(); t1.print(); t2.print(); t1.inc(); t1.print(); t2.inc(); t2.print(); } }