Which method is found in both the StreamReader and StreamWriter class?

  1. Close

  2. Peak

  3. Flush

  4. Both a and b.

  5. All of the above.


Correct Option: A
Explanation:

To solve this question, the user needs to have a basic understanding of the StreamReader and StreamWriter classes in .NET.

Option A: Close - This method is found in both the StreamReader and StreamWriter classes. It is used to close the underlying stream and free up any resources associated with it.

Option B: Peek - This method is not found in both the StreamReader and StreamWriter classes. It is only found in the StreamReader class and is used to return the next available character without reading it from the underlying stream.

Option C: Flush - This method is found in both the StreamReader and StreamWriter classes. It is used to flush the buffer and write any remaining data to the underlying stream.

Option D: Both A and B - This option is incorrect because option B is not found in both the StreamReader and StreamWriter classes.

Option E: All of the above - This option is incorrect because option B is not found in both the StreamReader and StreamWriter classes.

Therefore, the correct answer is:

The Answer is: A. Close.

Find more quizzes: