import java.io.*;
class javabaca
{
public static void main(String[]args)
{
try
{
FileOutputStream simpen=new FileOutputStream("fileku.txt");
PrintStream panggil=new PrintStream(javabaca);
panggil.println("MuhammadAmir");
panggil.println("20094350144");
panggil.println("3c(sore)");
panggil.close();
}
catch (Exception e)
{
System.err.println("error");
}
System.out.println("muhammadamir");
{
try
FileInputStream buka=new FileInputStream("file.txt");
DataInputStream lagi=new DataInputStream(javabaca);
while (lagi.available()!=0)
{
String hasil=lagi.readLine();
System.out.println(hasil);
}
lagi.close();
}
catch (Exception e)
{
System.err.println("error");
}
System.out.println("muhammadamir");
}
}
}
Tidak ada komentar:
Posting Komentar