java - How do I move two parallel arrays from one method to another, by returning to the main method then entering the second one? -
i need both string , double arrays go inputaccept table: inputaccept(); table(names, costs); public static void inputaccept() { scanner scan = new scanner(system.in); string[] names = {"","","","","","","","","",""}; double[] costs = new double[10]; (int = 0; < 10; i++) { system.out.println("enter name of item " + (i + 1) + ": "); names[i] = scan.nextline(); system.out.println("enter item cost: "); costs[i] = scan.nextdouble(); } } public static void table(string[] names, double[] costs) { //insert code using arrays } i know wrong, don't know fix it. you can create 2 arrays in main method, first pass them inputaccept method, pass 2 arrays table method: public static