sam lee
sam lee

Reputation: 73

subelements in an arraylist position

It is possible to have sub elements in an arraylist position like the one shown in the picture below?

enter image description here

Upvotes: 1

Views: 86

Answers (1)

Thomas Nairn
Thomas Nairn

Reputation: 1226

An ArrayList of Arrays or ArrayLists?

ArrayList<Object[]> arrays = new ArrayList<>();
arrays.add(new Object[3]);

ArrayList<ArrayList> arrays = new ArrayList<>();
arrays.add(new ArrayList());

Upvotes: 1

Related Questions