The StreamReader and StreamWriter class are both subclasses of which class?

  1. IO

  2. Stream

  3. StreamIO

  4. Both a and b.

  5. All of the above.


Correct Option: B

AI Explanation

To answer this question, we need to understand the relationship between the StreamReader and StreamWriter classes and their superclass.

Option A) IO - This option is incorrect because the StreamReader and StreamWriter classes are not subclasses of the IO class.

Option B) Stream - This option is correct because both the StreamReader and StreamWriter classes are subclasses of the Stream class. The Stream class is an abstract class in the System.IO namespace that provides a generic view of a sequence of bytes. It serves as the base class for all stream classes in .NET.

Option C) StreamIO - This option is incorrect because there is no class named StreamIO in the .NET framework.

Option D) Both a and b - This option is incorrect because the correct answer is only option B (Stream). The StreamReader and StreamWriter classes are subclasses of the Stream class, not the IO class.

Option E) All of the above - This option is incorrect because option B (Stream) is the correct answer, while options A (IO) and C (StreamIO) are incorrect.

Therefore, the correct answer is B) Stream.

Find more quizzes: