Leer un fichero linea a linea
Hola:
Necesitaria saber como leer linea a linea un fichero cualquiera. ¿Como se hace?
Necesitaria saber como leer linea a linea un fichero cualquiera. ¿Como se hace?
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();
}
}
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();
}
}