Friday, January 15, 2010

III. Each Question Carries 4 Mark.
1) class A { FileWriter f=new FileWriter(“a.txt”); f.write(“hello world “); f.close(); }
The above program is example for
a) bytes streams b) character streams c) both d) None

2) i) FileReader is the main class used when reading character streams from a file
ii) FileReader character stream is nested with the BufferedReader stream .
iii) readLine() allows to read data line by line
a) only i b) only i, iii c) All d) None

3) i) Character streams are used to work with any text that is represented by the ASCII or Unicode character set.
ii) Processing streams perform some sort of operation such as buffering or character encoding.
iii) The key to writing an object is to represent its state in a serialized from sufficient.
a) only i b) only i, iii c) All d) None




4) i) if you need to work with data is not represented as bytes or characters then use data input and out put streams.
ii) Datainputstream constructor argument should be existing inputstream
iii) FileOutputStream allows to store byte data .
a) only i b) only i, iii c) All d) None

5) class A { FileInputStream f=new FileInutStream(“a.gif”);
while( !f.eof() )
{ int input=f.read(); System.out.print(input);
}
}

The above example displays out put is_____
a) Character b) special characters c) numbers d) None



III. Answer – 4 Mark.


1. B 2.C 3. C 4. C 5.C