Hello,
I have an assignment and I need to use multidimensional ArrayList. I am not that familiar with ArrayList. I don't know how to set it up. I have to put values input by the user.
This is what i did so far:-
ArrayList <ArrayList <ArrayList <ArrayList <String>>>> items = new ArrayList <ArrayList <ArrayList <ArrayList <String>>>>();
System.out.println("Enter the item name you want to add in the trunk(without spaces): ");
String itemName = input.next();
System.out.println("Enter the item dimensions(in cubic feet, less than trunk's capacity i.e. " + trunkCapacity + "): ");
double itemDimensions = input.nextDouble();
System.out.println("Enter the weight of the item(in lbs, less than trunk's max maxx i.e. " + maxMass + "): ");
double itemMass = input.nextDouble();
items.add(itemName).add(itemDimensions).add(itemMass);
Can someone help me? Please
Thanks
Navp![]()
Bookmarks