What Will Be The Output Of The Following C Code Snippetp Pre #682
What will be the output of the following C# code snippet?</p> <pre><code class="language-csharp" line="1"> class UseTypeof { static void Main() { Type t = typeof(StreamReader); Console.WriteLine(t.FullName); if(t.IsClass) Console.WriteLine("Is a class."); if(t.IsAbstract) Console.WriteLine("Is abstract."); else Console.WriteLine("Is concrete."); } } </code></pre>
This multiple choice question (MCQ) is related to the book/course gs gs108 CSharp. It can also be found in gs gs108 Delegates, Generics and LINQ - Runtime Type - Quiz No.1.
What will be the output of the following C# code snippet?
class UseTypeof { static void Main() { Type t = typeof(StreamReader); Console.WriteLine(t.FullName); if(t.IsClass) Console.WriteLine("Is a class."); if(t.IsAbstract) Console.WriteLine("Is abstract."); else Console.WriteLine("Is concrete."); } }
Is a class Is abstract
Is abstract
System.IO.StreamReader Is a class Is concrete
Both Is a class Is abstract & System.IO.StreamReader Is a class Is concrete