I have many errors and issues with this. I am new to java and this code is throwing me way off. This is very important, please help.
import java.util.*; public class Grocery { public static void main(String[] args) { Scanner console = new Scanner(System.in); } private Scanner keybd; private ArrayList <> myList; //the <> are getting an error { keybd = new ArrayList(); //this is another error myList = new ArrayList(); //this is another error } public void startProgram() { int option = 0; System.out.println("Welcome to the Grocery Program!"); System.out.println("1. Create a new Grocery List"); System.out.println("2. Add sample items to the List"); System.out.println("3. Remove an Item from the List"); System.out.println("4. Print the list"); System.out.println("5. Print the cost of all the Items"); System.out.println("6. End the program"); option = keybd.nextInt(); keybd.nextLine(); switch (option) { case 1: createList(); //error //this is a break it will exit the loop break; case 2: setList(); //error break; case 3: removeItem(); //errpr break; case 4: printList(); //error break; case 5: printCost(); //error break; case 6: endProgram(); //error break; default: inCorect(); //error startProgram(); break; } } private void createList() { //this is a stopper the program will continue until it is typed String stop = "st0p"; String addAnother = ""; String newItem = ""; double newPrice = 0.0; //first we ask the question that the user will answer System.out.print("please enter an items name: "); String newItem = console.next(); //next we need to check that variable with the stop while(!(newItem.equals(stop))){ //now we ask the next question System.out.print("please enter an items price: "); String newPrice = console.next(); keybd.nextLine(); //this will add a blank line System.out.println(); //we than have to ask rhe question again System.out.print("please enter an items name: "); String addAnother = console.next(); if(newItem && newPrice ){ System.out.println("incorect item please try again"); createList(); }else{ myList.add(); } } startProgram(); } /* private void setList() { //this is sample data that we will fill in for testing purposes myList.add(); myList.add(); myList.add(); myList.add(new Grocery(); myList.add(; myList.add(); myList.add(); startProgram(); } */ private void removeItem() { //this is a for statement you need to have three statements inside for(){ //i add a number in front of every item for easy access to data System.out.print(index + " " ); myList.get(index).printItem(); } //ask a question System.out.println("which item would you like to remove?"); String remove = keybd.nextInt(); myList.remove(); startProgram(); } /** * this will print the list */ private void printList() { for(; ;index++){ myList.get(); } startProgram(); } /** * print just the price */ private void printCost() { for(; index < myList.size();){ System.out.println(myList.get()); } startProgram(); } /** * this is an incorrect message */ private void inCorect() { System.out.println("the item you are looking for is invalid please try again"); } /** * this is the end message */ private void endProgram() { System.out.println("Thanks for using this program"); } private double price; private String name; /** * This is the constructor */ public Grocery(String newName, double newPrice) { name = newName; price = newPrice; } //======================+Accessors+================================= /** * this method is to return the name of the item * * @return name of item */ public String getName() { return name; } /** * this will return the price * * @return price of item */ public double getPrice() { return price; } //======================+Mutators+================================== /** * this will set a new name of an item * * @param newName a caller will set the name */ public void setName(String newName) { name = newName; } /** * this will set a new price of an item * * @param newPrice a caller will set the price */ public void setPrice(double newPrice) { price = newPrice; } /** * this will print an item */ public void printItem() { System.out.println("the item is: " + name + " the price is: "+ price); }}