Can anybody tell me how to create an array-arraylist the right way ?!
.\File.java:5: warning: [unchecked] unchecked conversion
ArrayList<myObjectType> myParkingLotArray[] = new ArrayList[3];
^
required: ArrayList<Vehicle>[]
found: ArrayList[]
1 warning
I want an arry (or any other solution) which stores 3 arraylists. How to add objects to the arrylists would be nice to know too.
ParentArray
- ChildArrayList1
- ChildArrayList2
- ChildArrayList3
Im happy for any Help
SOLUTION:
public class myClass {
ArrayList<myObjectType>[] myArryName= new ArrayList[3];
public void addLists() {
myArryName[0] = new ArrayList<myObjectType>();
myArryName[1] = new ArrayList<myObjectType>();
myArryName[2] = new ArrayList<myObjectType>();
}
}
The warning can be ignored or suppressed.