0

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?

0

1 Answer 1

5

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?

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.