Example #1
0
 public void action(String word, Scanner input) {
   if (word.equalsIgnoreCase("/switch") || word.equalsIgnoreCase("/s")) {
     try {
       super.chooseBank();
     } catch (FileNotFoundException e) {
       // Handle the exception
     }
   } else if (word.equalsIgnoreCase("/quit") || word.equalsIgnoreCase("/q")) {
     quit();
   } else if (word.equalsIgnoreCase("/bank")) {
     getBank();
     define(input);
   } else if (word.equalsIgnoreCase("/add")) {
     addDef(file);
   } else if (word.equalsIgnoreCase("/help") || word.equalsIgnoreCase("/?")) {
     getHelp();
     System.out.println("\n");
     System.out.println("Enter a help function to be defined: ");
     helpDefine(input.nextLine(), input);
     define(input);
     // Update Comment
   }
 }