的方法首先發布在這裏!JAVA- NETBEANS-返回一個代碼爲
所以我有這段代碼:
static boolean getInternationalCalls() {
Scanner intercalls = new Scanner(System.in);
System.out.println("Would the customer like International Calls to be included within their minutes?");
System.out.println("If yes, please enter Y, if no please enter N below.");
Scanner scanner = new Scanner(System.in);
if (scanner.next().equalsIgnoreCase("Y") || scanner.next().equalsIgnoreCase("yes")) {
System.out.println("Internatinal Calls will be included");
} else if (scanner.next().equalsIgnoreCase("N") || scanner.next().equalsIgnoreCase("no")) {
System.out.println("International Calls will not be included");
} else {
System.out.println("Invalid character, please enter Y or N");
}
困惑自己,不知道怎麼寫的return語句
將其返回到:
布爾interCalls = getInternationalCalls();
在此先感謝! :)
[返回從方法中值(https://docs.oracle.com/ JavaSE的/教程/ JAVA/javaOO/returnvalue.html) – MadProgrammer