Foo f = new Foo( 12, 3.4 );
int x = f.getFirst();

public class Foo {
    private int first;
    private double second;

    public Foo( int first, double second ) {
        this.first = first;
        this.second = second;
    }

    public int getFirst() {
        return first;
    }

    public double getSecond() {
        return second;
    }
}