Quantcast
Channel: Java Archives - Java Code Geeks
Viewing all articles
Browse latest Browse all 772

Closing Scanner Java Example

$
0
0
1. Introduction The java.util.Scanner class can read input from System.in, File, InputStream, Path, Readable, String, etc. It implements the Closeable and AutoCloseable interfaces. The scanner close method will close its input source if the input source implements the Closeable interface. In this example, I will demonstrate how Eclipse IDE detects the resource leak and how …

Viewing all articles
Browse latest Browse all 772

Trending Articles