All pastes #751001 Raw Edit

Absurd-Mind

public text v1 · immutable
#751001 ·published 2007-10-26 23:32 UTC
rendered paste body
import 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