What is nested Classes?
Nested classes are classes within classes.
If you create the child class object which constructor will fire first?
public class class1
public class class2 : class1
Parent class constructor will fire first.
In what instances you will declare a constructor to be private?When we create a private constructor, we cannot create object of the class. Private constructors are used when we want only a single instance of the class to be created and externally no one can use the ‘new’ keyword to create the object.
Can we have different access modifiers on get/set methods of a property?Yes, we can have different access modifiers. The below code will compile perfectly well.
public string CustName
Custname = value;
See following video on which constructor fires first in parent-child relationship: -
If you want to learn or want more on
.NET learning then