반응형
import java.io.*;
public class Mains
{
public static void main(String[] args)
{
File file = new File("c:\\java\\abc.txt");
try{
FileOutputStream fos = new FileOutputStream(FileDescriptor.out);
FileOutputStream fos1 = new FileOutputStream(file);
byte[] data = {66, 68, 70, 72, (byte)'!'};
fos.write(data);
fos1.write(data);
} catch(FileNotFoundException fnfe){
System.out.println("파일을 못 찾겠다");
System.exit(1);
} catch(IOException io){
System.out.println("파일 입출력 에러!!");
System.exit(1);
}
System.out.println("실행끝..!!");
}
}
반응형