public static void main(String[] args) {
try {
External.ABHolder holder = new External.ABHolder();
holder.a = 10;
holder.b = 13;
final External ext = new External(holder);
holder = ext.getHolder();
System.out.printf("a=%d b=%d\n", holder.a, holder.b);
holder.a = 5;
holder = ext.getHolder();
System.out.printf("a=%d b=%d\n", holder.a, holder.b);
External.Pavlik p = ext.getPavlik();
p.setA(34);
holder = ext.getHolder();
System.out.printf("a=%d b=%d\n", holder.a, holder.b);
p = ext.getShtirlits();
p.setA(34);
holder = ext.getHolder();
System.out.printf("a=%d b=%d\n", holder.a, holder.b);
} catch (CloneNotSupportedException ex) {
ex.printStackTrace();
}
}