Java中的字節輸入出流和字符輸入輸出流
Java中的字節輸入出流和字符輸入輸出流
以下哪個流類屬於面向字符的輸入流( )
A BufferedWriter
B FileInputStream
C ObjectInputStream
D InputStreamReader
解析:IO流
(1)字節輸入流
基類:InputStream
FileInputStream、ByteArrayInputStream、PipedInputStream、BufferedInputStream、ObjectInputStream、FilterInputStream、PushbackInputStream、DataInputStream
(2)字節輸出流
基類:OutputStream
FileOutputStream、ByteArrayOutputStream、PipedOutputStream、BufferedOutputStream、ObjectOutputStream、FilterOutputStream、PrintStream、DataOutputStream
(3)字符輸入流
基類:Reader
FileReader、CharArrayReader、PipedReader、StringReader、BufferedReader、InputStreamReader、FilterReader、PushbackReader
(4)字符輸出流
基類:Writer
FileWriter、CharArrayWriter、PipedWriter、StringWriter、BufferedWriter、OutputStreamWriter、FilterWriter、PrintWriter
答案:D。
Java中的字節輸入出流和字符輸入輸出流