In my program, I parse files. I open them like this:
Scanner s = new Scanner(new BufferedReader(new FileReader("file1.txt")));
and close it like this:
s.close();
My question is: when I do s.close() does this also close the FileReader and the BufferedReader too?
Java doc say
Since
BufferedReaderhas implementedCloseableand it will invoke buffer reader close method.