why do we need to close scanner in java code example
Example: close scanner java
Scanner scanner = new Scanner("Hello world");
//do something with scanner
scanner.close();
Scanner scanner = new Scanner("Hello world");
//do something with scanner
scanner.close();