Absurd-Mind
public text v1 · immutableimport util.Pair;
public class CloneTest {
public static void main(String[] args) {
Pair<Integer, Float> a = new Pair<Integer, Float>(2, 5.4f);
Pair<Integer, Float> b;
System.out.println("a: " + a);
b = a;
System.out.println("a: " + a);
System.out.println("b: " + b);
a.setFirst(4);
a.setSecond(2.3f);
System.out.println("a: " + a);
System.out.println("b: " + b);
}
}
Output:
a: 2 5.4
a: 2 5.4
b: 2 5.4
a: 4 2.3
b: 4 2.3