import java.io.*;
class bacastringandfile
{
public static void main (String [] args)
{
try
{
FileInputStream fstream = new FileInputStream("myfile.txt");
DataInputStream datainput = new DataInputStream(fstream);
while (datainput.available()!=0)
{
String data = datainput.readLine();
System.out.println(data);
}
datainput.close();
}
catch (Exception x)
{
System.out.println("File Input Error");
}
}
}
Tidak ada komentar:
Posting Komentar