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[
You can assign the result of br.readLine() to a variable and use that both for processing and for checking, like so:
br.readLine()
String line = br.readLine(); while (line != null) { // You might also want to check for empty? System.out.println(line); line = br.readLine(); }