- FileReader
- Scanner
- BufferedReader & Writer
FileReader
System.util.*;
Scanner
import java.util.Scanner;
public class ForTest {
public static void main(String[] args) {
Scanner scan=new Scanner(System.in);
}
}
System.io.*;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
public class ForTest {
public static void main(String[] args) throws IOException {
BufferedReader scan=new BufferedReader(new InputStreamReader(System.in));
}
}
BufferedWriter+OutputStreamWriter
import java.io.IOException;
import java.io.BufferedWrtier;
import java.io.InputStreamWriter;
public class ForTest{
public static void main(String[] args) throws IOException {
BufferedWriter pen=new BufferedWriter(new OutputStreamWriter(System.out));
}
}
FileWriter
import java.io.FileWriter;
import java.io.IOException;
public class Main {
static void main(String[] args) {
try {
FileWriter fw=new FileWriter("test.txt");
System.out.println("파일 쓰기 준비 완료!");
} catch (IOException ioe) {
System.out.println("폴더 경로 이상");
}
}
}