MCQs > IT & Programming > C# > What will be the output of the following program? class Program { public class Base { public Base() { Console.WriteLine("Parameterless constructor"); } public Base(int x) : this() { Console.WriteLine("Constructor with parameter {0}",x); } static Base() { Console.WriteLine('Static constructor'); } } static void Main(string[] args) { var one = new Base(5); var two = new Base(6); } }

C# MCQs

What will be the output of the following program? class Program { public class Base { public Base() { Console.WriteLine("Parameterless constructor"); } public Base(int x) : this() { Console.WriteLine("Constructor with parameter {0}",x); } static Base() { Console.WriteLine("Static constructor"); } } static void Main(string[] args) { var one = new Base(5); var two = new Base(6); } }

Answer

Correct Answer: Static constructor Parameterless constructor Constructor with parameter 5 Parameterless constructor Constructor with parameter 6

Explanation:

Note: This Question is unanswered, help us to find answer for this one

C# Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it

search

C# Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it