In [ ]:
public class Value {
public int number;
public Value (int number) {
this.number = number;
}
}
In [ ]:
Value a = new Value(15),
b = new Value(10),
c,
d,
e = new Value(0);
d = b;
e.number = b.number;
b = a;
c = a;
c.number = 8;
e = b;
System.out.println("a: " + a.number);
System.out.println("b: " + b.number);
System.out.println("c: " + c.number);
System.out.println("d: " + d.number);
System.out.println("d: " + e.number);
d.number = 35;
System.out.println("a: " + a.number);
System.out.println("b: " + b.number);
System.out.println("c: " + c.number);
System.out.println("d: " + d.number);
System.out.println("d: " + e.number);