csharp Class Questions & Answers

Question 1: Which of the following is the default access modifier in a namespace?

Question 2: Which of the following is the default access modifier of the class members?

Question 3: Which of the following keyword is used to reference two assemblies with the same fully qualified type names?

ADVERTISEMENT

Question 4: What is missing in the below class definition in order to successfully compile?

public Person
{
	public string Name{ get; set; }
}

Question 5: Which is the auto-implemented property in the below code snippet?

public class Person
{
	int Id = 0;
	public sting Name{ get; set; }
      
	private int _age;
    
    public int Age
    {
        get { return _age; }
        set { _age = value; }
    }
}