I am constructing a Java program which acts as shop managing system. Staff run the software and it collects the information from a file which is named data.txt. The information contained in this file is layed out as so:
Item name, Item price
I need to use the split method to seperate the name and the price and probably store them in an ArrayList, however I am not confident with the split method.
***This is the split method from the java.lang.String class***
Here is the code below. I have written in red
where the problem is.
public class CoffeeShop
private HashMap<String, SalesPerson> employees;
private ArrayList<Category> categories;
private Reader menu;
employees = new HashMap<String, SalesPerson>();
categories = new ArrayList<Category>();
menu = new Reader("data.txt");
String items = menu.split(","); Error here...and don't know what to do.
Any help is appreciated!