Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
- package lab6_fileReadWrite;
- import java.io.*;
- import java.util.logging.Level;
- import java.util.logging.Logger;
- /**
- *
- * @author acer
- */
- public class fileReader {
- public static void main(String[] args) {
- try {
- FileReader fw=new FileReader("C:\\Users\\acer\\Desktop\\new.txt");
- BufferedReader br=new BufferedReader(fw);
- String str;
- while((str=br.readLine())!=null){
- System.out.println(str+"\n");
- }
- br.close();
- }
- catch (IOException ex) {
- Logger.getLogger(fileReader.class.getName()).log(Level.SEVERE, null, ex);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement