package stream;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
public class Baca {
public static void main(String[] args) throws FileNotFoundException, IOException {
FileOutputStream out = null;
File file = new File("Latihan.txt");
out = new FileOutputStream(file);
String nim = "105314009";
String nama = "sadhega";
String idKoleksi = "001";
String judul = "Laskar Pelangi";
String txt = idKoleksi + "\t" + judul + "\n";
out.write(txt.getBytes());
out.close();
}
}
Tidak ada komentar:
Posting Komentar