You can make it like :
List<Object> sections = new ArrayList <Object>();
(Recommended) Another possible solution would be to make a custom model class with two parameters one Integer and other String. Then using an ArrayList
of that object.
More Related Contents:
- ArrayList is reinitialising when a method is called
- why is it that we can’t use ArrayList.get(-1) to get the last element of the ArrayList in java? it works in python though [closed]
- How to arrange the datas to display in array by given string of days in java?
- ArrayList Data Structure – Daily Temperature
- I am new in using ArrayLists. Array Out of Bounds, Array seems to be empty, but have been adding Strings to it already
- When to use LinkedList over ArrayList in Java?
- How to count the number of occurrences of an element in a List
- Which Java Collection should I use?
- Initial size for the ArrayList
- Why start an ArrayList with an initial capacity?
- Java: Detect duplicates in ArrayList?
- Delete data from ArrayList with a For-loop
- Performance differences between ArrayList and LinkedList
- Performance of traditional for loop vs Iterator/foreach in Java
- How to get the last value of an ArrayList
- Firebase Firestore get data from collection
- How to zip two Java Lists
- Java – Removing duplicates in an ArrayList
- Concurrent threads adding to ArrayList at same time – what happens?
- Modifier static is only allowed in constant variable declarations
- How do I declare a 2D String arraylist?
- Fastest way to recreate the ArrayList in a for loop
- How to insert an object in an ArrayList at a specific position
- Removing Duplicate Values from ArrayList
- Permutation algorithm for array of integers in Java
- How can I create an array in Kotlin like in Java by just providing a size?
- Time complexity of contains(Object o), in an ArrayList of Objects
- Create an array of ArrayList elements
- ArrayList Generic without Type
- Iterate ArrayList in JSP