package com.as400samplecode; import java.io.BufferedReader; import java.io.FileReader; import java.io.IOException; public class FileBufferedReader { public static void main(String[] args) { BufferedReader bufferedReader = null; try { String sCurrentLine; bufferedReader = new BufferedReader(new FileReader("data/newFile.txt")); while ((sCurrentLine = bufferedReader.readLine()) != null) { System.out.println(sCurrentLine); } } catch (IOException e) { e.printStackTrace(); } finally { try { if (bufferedReader != null){ bufferedReader.close(); } } catch (IOException ex) { ex.printStackTrace(); } } } }
All one can think and do in a short time is to think what one already knows and to do as one has always done!
No comments:
Post a Comment
NO JUNK, Please try to keep this clean and related to the topic at hand.
Comments are for users to ask questions, collaborate or improve on existing.