【发布时间】:2022-06-29 13:53:09
【问题描述】:
int selection = 0;
showMenu(selection);
}
public static int showMenu(int selection) {
Scanner key = new Scanner(System.in);
System.out.println("METER CONVERSION\n1) Convert to Kilometers\n2) Convert to Inches\n3) Convert to Feet\n4) Quit the Program");
System.out.println("Please make a selection: ");
selection = key.nextInt();
return selection;
}
我需要知道如何将 showMenu 中的值返回给变量选择。
【问题讨论】: