public class Demo { public static void main(String[] ags) { Test o1 = new Test(); Test o2 = new Test(); Test o3 = o2; System.out.println(o1.number); } } class Test { static int number=0; public Test() { number++; } }
public class Analyze { private int x; public static void main(String[] args) { Analyze tmp = new Analyze(); System.out.println(tmp.x); } }
class Scope { private int x; public Scope () {x = 0;} public void method() { int x = 1; System.out.print( this.x ); } }