Leer un fichero linea a linea

Jose Quevedo
25 de Noviembre del 2004
Hola:

Necesitaria saber como leer linea a linea un fichero cualquiera. ¿Como se hace?

Khriztian
25 de Noviembre del 2004
Ejecuta esto :

import java.io.*;

class MuestraCarta {
public static void main(String args[]) throws IOException {
int c;

FileInputStream f=new FileInputStream("carta.txt");

while( ( c=f.read() ) != -1 )
System.out.print( (char)c );

f.close();
}
}

Jose Quevedo
25 de Noviembre del 2004
Muchas gracias