Sin's picture
initial commit
b55ca22
raw history blame
No virus
1.06 kB
/*
* 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 testbufferedreader;
import java.io.*;
/**
*
* @author etudiant
*/
public class TestBufferedReader {
protected String source;
public TestBufferedReader(String source)
{
this.source = source;
lecture();
}
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
// TODO code application logic here
new TestBufferedReader("source.txt");
}
private void lecture()
{
try {
String ligne;
BufferedReader fichier = new BufferedReader(new FileReader(source));
while ((ligne = fichier.readLine())!= null)
{
System.out.println(ligne);
}
fichier.close();
}
catch (Exception e)
{
e.printStackTrace();
}
}
}