This section of our 1000+ C# MCQs focuses on character streams of C# Programming Language.
1. From which of these classes, the character based output stream class Stream Writer is derived?
a) TextWriter
b) TextReader
c) Character Stream
d) All of the mentioned
2. The advantages of using character stream based file handling are?
a) they operate directly on unicode characters
b) they operate directly on bits
c) they store unicode text
d) all of the mentioned
3. Which among the following classes are used to perform the character based file operations?
a) StreamReader
b) InputReaderWriter
c) OutputStream
d) All of the mentioned
4. Which of these is a method used to clear all the data present in output buffers?
a) clear()
b) flush()
c) fflush()
d) close()
5. Which method of the character stream class returns the numbers of characters successfully read starting at index?
a) int Read()
b) int Read(char[] buffer, int index, int count)
c) int ReadBlock(char[ ] buffer, int index, int count)
d) none of the mentioned
6. Which method of character stream class returns the numbers of characters successfully read starting at count?
a) int Read()
b) int Read(char[] buffer, int index, int count)
c) int ReadBlock(char[ ] buffer, int index, int count)
d) none of the mentioned
7. Which method among the following returns the integer if no character is available?
a) int peek()
b) int read()
c) string ReadLine()
d) none of the mentioned
8. Which of the following is used to perform all input & output operations in C#?
a) streams
b) Variables
c) classes
d) Methods
9. Which of the following is a type of stream in C#?
a) Integer stream
b) Character stream
c) Float stream
d) Long stream
10. In the given constructor declaration for character based file operation what does ‘path’ and ‘bool specifies?
StreamWriter(string path, bool append)
a) the name of the file to open
b) specifies the full path of file
c) if append is true, the file is appended to the end of the existing file
d) all of the mentioned