//我的问题是在方法 cancelledOrder 中没有看到字符串 [] waitingList[] 至少我是这么认为的。
public static String[] canceledOrder(String[] waitingList,String[] waitingList1,String []waitingList2,String[] waitingList3){//I've decided to pass these string [] hoping the string from the other methods will now be seen in canceledOrder();
Scanner in = new Scanner (System.in);
int option;
System.out.println("Select the event you want to cancel :\n");
events();
option= in.nextInt();
in.nextLine();
System.out.println("Person on wait list is " + waitingList[name] );
switch (option){
case 1:
System.out.println("Please enter your name:\n");
canceledname = in.nextLine();
System.out.println("name:" + canceledname);
for (String s : myStringList) {
if(s.equals(canceledname)){
s = waitingList[name];
System.out.println("The new name is\n" + s);
name++;
}
return s; // I want it to now return waitingList[name]
}
break;