Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Triples in Java [duplicate]

Possible Duplicate:
Does Java need tuples?

Does Java support triples or at least pairs? Does Java support tuples? I am trying to find a way to make a list so that it has a triple with initial point as first, terminal point at last, and distance in the middle. However, I can't seem to find anything about it.

like image 205
D347th Avatar asked Dec 28 '22 12:12

D347th


1 Answers

I usually just create my own class for these purposes.

class Pair<A,B> {
    A a;
    B b;
    public Pair( A a, B b ) {
        this.a = a;
        this.b = b;
    } 
}
like image 100
tskuzzy Avatar answered Dec 30 '22 16:12

tskuzzy