I want to know if I can create a 2D collection object just as a 2D array. Kindly advice.
Asked
Active
Viewed 49 times
2 Answers
1
Yes, you can. Example:
ArrayList<ArrayList<Object>> list = new ArrayList<ArrayList<Object>>();

Cardinal System
- 2,749
- 3
- 21
- 42
-1
Your question does not illustrate your intention clearly. But if you need a tuple, you should implement it or use external libraries. For example this is an implementation of Pair (Tuple with two elements):

IT man
- 563
- 6
- 9
>`. This way you can simulate a multi-dimensional collection.
– VPK Dec 21 '17 at 04:23