0
我迄今爲止代碼:使主要方法重啓/刷新
import java.util.*;
import java.util.Scanner.*;
public class Project{ // The Main Method
public static void main(String [] args){ // Creates the Main Method
System.out.println("Name a Method (Stability, efficiency ..)"); // Asks the user to select a method
Scanner scan = new Scanner(System.in); // Creates the Scanner
String splash = scan.nextLine(); // Transitions the user to the next line after choosing a method
if(splash.equals("efficiency")) // If users chooses Efficiency then it goes to the Efficiency method
{
efficiency(); // Calls the Efficiency method
}
if(splash.equals("Stability")) // If user chooses Stability then it goes to the Stability Method
{
stable(); // Calls the Stability method
}
else // What happens if the input wasnt recognized
{
System.out.println("I don't recognize this"); // what happens if an irrelevant method is chosen
}
}
}
我將如何讓這個代替:
else // What happens if the input wasnt recognized
{
System.out.println("I don't recognize this"); // what happens if an irrelevant method is chosen
}
這將刷新或重新啓動的主要方法是什麼?
你能也許把它與正確的括號內的主要方法是什麼?我越來越混合括號 – 2013-05-08 13:30:20
@ user2335970:像這樣? – Kai 2013-05-08 13:32:00
謝謝你!〜!! – 2013-05-09 13:11:45