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

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

class Other {
	private int x;
	public int getX() {
		return x;
	}
	public void setX(int x) {
		this.x = x;
	}
}
