Which abstract class is the super class of all classes used for
reading bytes. Select the one correct answer.
Reader
FileReader
ByteReader
InputStream
FileInputStream
Which abstract class is the super class of all classes used for
writing characters. Select the one correct answer.
Writer
FileWriter
CharWriter
OutputStream
FileOutputStream
Which of these are legal ways of accessing a File named "file.tst"
for reading. Select all correct answer.
FileReader fr = new FileReader("file.tst");
FileInputStream fr = new
FileInputStream("file.txt"); InputStreamReader isr = new
InputStreamReader(fr, "UTF8");
FileReader fr = new FileReader("file.tst", "UTF8");
InputStreamReader isr = new InputStreamReader("file.tst");
Name the class that allows reading of binary representations of Java
primitives from an input byte stream.
Which of these classes are abstract. Select all correct answer.
FilterWriter
Reader
InputStream
CharArrayReader
DataInputStream
Name the exception thrown by the read method defined in InputStream
class
Answers to questions on Files and I/O
d
a
a, b. FileReader class uses the default character encoding, hence c
is incorrect. InputStreamReader character class does not have a
constructor that takes file name as an argument. Hence d is incorrect.