MCQs > IT & Programming > C# > What is the output of the following code snippet. public class ClassOne { public ClassOne(int id, string name, bool isTest) { this.ID = id; this.Name = name; this.IsTest = isTest; } public int ID { get; private set; } public string Name { get; protected set; } protected bool IsTest { get; internal set; } } public void Run() { ClassOne one = new ClassOne(1, 'John', false); Console.WriteLine(one.Name); }

C# MCQs

What is the output of the following code snippet. public class ClassOne { public ClassOne(int id, string name, bool isTest) { this.ID = id; this.Name = name; this.IsTest = isTest; } public int ID { get; private set; } public string Name { get; protected set; } protected bool IsTest { get; internal set; } } public void Run() { ClassOne one = new ClassOne(1, "John", false); Console.WriteLine(one.Name); }

Answer

Correct Answer: Compile Run Time Error The accessibility modifier on ClassOne.IsTest.set must be more restrictive than the property or indexer 'ClassOne.IsTest'

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