Closing Scanner

master
Hammy 4 years ago
parent dda6f5690b
commit 0fd038a2cf

@ -18,6 +18,7 @@ public class NewCalcEngine {
Scanner in = new Scanner(System.in); Scanner in = new Scanner(System.in);
System.out.println("Enter In Your Operation Please: \n"); System.out.println("Enter In Your Operation Please: \n");
String userInput = in.nextLine(); String userInput = in.nextLine();
in.close();
dynamicHelper.process(userInput); dynamicHelper.process(userInput);
@ -27,6 +28,8 @@ public class NewCalcEngine {
Scanner in = new Scanner(System.in); Scanner in = new Scanner(System.in);
System.out.println("Please Enter In A Calculation: \n"); System.out.println("Please Enter In A Calculation: \n");
String userInput = in.nextLine(); String userInput = in.nextLine();
in.close();
String parts[] = userInput.split(" "); String parts[] = userInput.split(" ");
performOperation(parts); performOperation(parts);

Loading…
Cancel
Save