i have an ArrayList called e.g. Fridge
List<Food> fridge = new ArrayList<Food>();
An simple explanation: Because i want to keep my fridge organized i want to put my food into seperate drawers. I already have the Classes Meat, Fruit and Bread.
The point i am struggling with is to create new ArrayList's which picture the different drawers.
My goal is to have the fridge List a parent list and meat,fruit,bread as children of this list.
fridge (Parent)
---meat (Child)
---fruit (Child)
---bread (Child)
Do you have any ideas how to realize this ? I'm glad for any help
EDIT: The Objects i want to add to thesublists contain informations such as String obj.name; double obj.weight; double obj.price; i want to add the objects to the sublists and be able to read the sublists out again.
ArrayListfor each type of food and then makefridgeanArrayListofArrayLists.ArrayListfor each type of food and then make aTreeMapfor each type of food, containing those ArrayLists.Map<String,List<Food>> fridge = new TreeMap<>().FridgeClass...