Java 2D ArrayList and sorting
问题 I need to sort a shopping list by the aisle the item is located for example: [Bread] [1] [Milk] [2] [Cereal] [3] I am planning to do this with ArrayList and was wondering how to make an 2D ArrayList Bonus questions: any ideas on how to sort by the aisle number? 回答1: Don't you have a class that holds your item + aisle information? Something like: public class Item { private String name; private int aisle; // constructor + getters + setters } If you don't, consider making one - it's definitely