mino
mino

Reputation: 7298

Java - Possible to have more than one data type using ArrayList?

Is it possible to have more than one data type within an array list, or even two of the same data type such as:

ArrayList<Integer,Integer,Integer> triple = new ArrayList<Integer,Integer,Integer>();

I notice this causes an error but I'm just wondering if there is indeed a way to do this?

Upvotes: 0

Views: 348

Answers (1)

I82Much
I82Much

Reputation: 27336

No. If you defined a class Triple<Integer, Integer, Integer>, you could in turn have an ArrayList<Triple<Integer, Integer, Integer>>, however.

Is this for some sort of list of 3d points?

Upvotes: 5

Related Questions