// Collection of code snippets by Arne Vajhøj 
// (from articles on eksperten.dk / vajhoej.dk written sometime between 2004 and now) 
package classes.methodinner;

public class Demo {
	private int v;
	public int getV() {
		return v;
	}
	public void setV(int v) {
		this.v = v;
	}
	public void test() {
		class Other {
			private int x;
			public int getX() {
				return x;
			}
			public void setX(int x) {
				this.x = x;
			}
			public void test() {
				System.out.printf("Outer v = %d\n",  getV());
			}
		}
		Other other = new Other();
		other.setX(456);
		System.out.printf("Other x = %d\n", other.getX());
		other.test();
	}
	public static void main(String[] args) {
		Demo demo = new Demo();
		demo.setV(123);
		System.out.printf("Demo v = %d\n", demo.getV());
		demo.test();
	}
}

