Check out example codes for "close scanner java". It will help you in understanding the concepts better.

Code Example 1

Scanner scanner = new Scanner("Hello world");

//do something with scanner

scanner.close();

Learn ReactJs, React Native from akashmittal.com