Declare an ArrayList named productList of five elements of typeProduct and construct the elements using the 2-argconstructor of Product class: this example is worked out foryou.
ArrayList productList = new ArrayList();
//Add objects to array List
productList.add(new Product(21,”Green-Tea”, 5.50));
productList.add(new Product(22,”Black-Tea”, 6.50));
productList.add(new Product(23,”Coffee-Keurig 20 oz”,15.00));
productList.add(new Product(24,”Sugar – store brand 1 lbs”,3.50));
productList.add(new Product(25,”Hot choc Store brand 1 lbs”,4.50));
Looking at the above example, declare
OR
OR