I have an array list with the name and cost of an item, however, I'd like to separate the two, especially so that I can sum the values of the costs.
heres what I have so far:
import java.util.ArrayList;
public class henrys {
public static ArrayList<String> products = new ArrayList<String>();
public static void main(String[] args) {
products.add("Calvin Klein Blue Shorts, Size: Medium, $45");
products.add("Ralph Lauren Blue Shirt, Size: Large, $50");
products.add("Gap Beige Khakis, Size: 30, $20");
products.add("Calvin Klein Black Shirt, Size: Medium, $35");
products.add("USA Jersey White, Size: Medium, $100");
System.out.println((products));
}
}