import java.io.*;
public class Foo {
public static void main(String args[]) {
try {
BufferedWriter out = new BufferedWriter(new FileWriter("out.txt"));
String s = "test";
out.write(s); out.newLine();
out.write(s); out.newLine();
out.close();
} catch (IOException e) {
System.err.println(e);
System.exit(1);
}
}
}
================================================================================================
public class Foo {
public static void main(String args[]) {
try {
BufferedWriter out = new BufferedWriter(new FileWriter("out.txt"));
String s = "test";
out.write(s); out.newLine();
out.write(s); out.newLine();
out.close();
} catch (IOException e) {
System.err.println(e);
System.exit(1);
}
}
}
================================================================================================
out.txt 내용
test
test
'How to. > Java Programming' 카테고리의 다른 글
java vo 내용 출력 (0) | 2023.07.07 |
---|---|
SCJP 가상 TEST 프로그램 및 310-065.v2010-12-01 (0) | 2011.01.10 |
JAVA HashSet 파일내용 비교 (0) | 2011.01.01 |
Java 두 Text 파일 비교 예제 (0) | 2011.01.01 |
JAVA 디렉토리 목록 리스트파일로 만들기 예제 (0) | 2010.12.20 |