I\'m having problems with using the BufferedReader
I want to print the 6 lines of a text file:
public class Reader { public static void main(String[
Use try with resources. this will automatically close the resources.
try (BufferedReader br = new BufferedReader(new FileReader("C:/test.txt"))) { String line; while ((line = br.readLine()) != null) { System.out.println(line); } } catch (Exception e) { }