91. Choose the object/objects defined by the Textwriter class.
92. Which of the following is a type of stream in C#?
93. The method used to write a single byte to an output stream?
94. Which of the following cannot further inspect the attribute that is once applied?
95. Select the correct statement about Attributes used in C#.NET?
96. In the given constructor declaration for character based file operation what does 'path' and 'bool specifies?
StreamWriter(string path, bool append)
StreamWriter(string path, bool append)
97. Choose the stream class method which is used to close the connection?
98. What will be the output of the following C# code snippet?
static void Main(string[] args)
{
String a ="i love iostream";
Console.WriteLine(a.IndexOf('i') + " " + a.IndexOf('e') + " " + a.LastIndexOf('i') + " " + a.LastIndexOf('e'));
Console.ReadLine();
}
static void Main(string[] args)
{
String a ="i love iostream";
Console.WriteLine(a.IndexOf('i') + " " + a.IndexOf('e') + " " + a.LastIndexOf('i') + " " + a.LastIndexOf('e'));
Console.ReadLine();
}
99. What will be the output of the following C# code?
static void Main(string[] args)
{
int a = 10, b = 0;
int result;
Console.Out.WriteLine("This will generate an exception.");
try
{
result = a / b; // generate an exception
}
catch (DivideByZeroException exc)
{
Console.Error.WriteLine(exc.Message);
}
Console.ReadLine();
}
static void Main(string[] args)
{
int a = 10, b = 0;
int result;
Console.Out.WriteLine("This will generate an exception.");
try
{
result = a / b; // generate an exception
}
catch (DivideByZeroException exc)
{
Console.Error.WriteLine(exc.Message);
}
Console.ReadLine();
}
100. Which of these classes is used to read and write bytes in a file?
Read More Section(File Handling and Input Output in C Sharp)
Each Section contains maximum 100 MCQs question on File Handling and Input Output in C Sharp. To get more questions visit other sections.