Consider the following snippet:
try (FileReader inputFile = new FileReader(file)) { //#1 System.out.print( (char)ch ); } }
Which one of the following statements can be replaced in the place of statement #1?
read()
) != null) {read()
) != -1) {read()
) != 0) {read()
) != EOF) {b)
The read()
method returns -1 when the file reaches the end.