I am trying to read a file using FileReader. save it in BufferedReader and print it in a new file using PrintWriter. But the condition is that i need to print only 8 lines from a file of 200 lines.
How to print nextLine from BufferedReder ???
in reading loop what you were doing is reading the file until the buffereReader.nextLine() exists rather than doing this you should just loop for about 8 iteration and then in these loop read from bufferedReader.
by this you will be able to read 8 lines.
You didn't tell me he was so big. Unlike this tiny ad:
a bit of art, as a gift, the permaculture playing cards