What Will Be The Output Of The Following C Codep Pre Langcsharp #369
What will be the output of the following C# code?</p> <pre><code class="language-csharp" line="1"> using System; public class BaseClass { public BaseClass() { Console.WriteLine("I am a base class"); } } public class ChildClass : BaseClass { public ChildClass() { Console.WriteLine ("I am a child class"); } static void Main() { ChildClass CC = new ChildClass(); } } </code></pre>
This multiple choice question (MCQ) is related to the book/course gs gs108 CSharp. It can also be found in gs gs108 Object Oriented Concepts - Inheritance Implementation - Quiz No.2.
What will be the output of the following C# code?
using System; public class BaseClass { public BaseClass() { Console.WriteLine("I am a base class"); } } public class ChildClass : BaseClass { public ChildClass() { Console.WriteLine ("I am a child class"); } static void Main() { ChildClass CC = new ChildClass(); } }
I am a base class I am a child class
I am a child class I am a base class
Compile time error
None of the mentioned