Close the scanner
This commit is contained in:
parent
555b715444
commit
652d227982
@ -14,7 +14,7 @@ public class CountChar {
|
||||
Scanner input = new Scanner(System.in);
|
||||
System.out.print("Enter your text: ");
|
||||
String str = input.nextLine();
|
||||
|
||||
input.close();
|
||||
System.out.println("There are " + CountCharacters(str) + " characters.");
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user