Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.io.*;
- public class FileRW {
- public static void main(String[] args) {
- writeF("namaFile.txt", "Pondok", "Programmer");
- }
- public static void writeF(String[] args) {
- PrintWriter fw = null;
- try{fw = new PrintWriter(args[0], "UTF-8");}
- catch(FileNotFoundException errorText) {System.out.println("ada error : "+errorText);}
- catch(UnsupportedEncodingException errorText) {System.out.println("ada error : "+errorText);}
- for(int i=1 ; i<=args.length ; i++){
- fw.println(args[i]);
- }
- fw.close();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement