A method can return a primitive value or a struct object, but it cannot return an object that is an instance of a class.
Blog
To make a property read-only, omit the set accessor for the…
To make a property read-only, omit the set accessor for the property.
If a reference field is declared as readonly, it is guarante…
If a reference field is declared as readonly, it is guaranteed that the values of the properties and or fields of the object that the field refers to cannot be changed.
The keyword this is the name of a reference variable that an…
The keyword this is the name of a reference variable that an object can use to refer to itself.
It is permissible to pass null as an argument to a reference…
It is permissible to pass null as an argument to a reference type parameter in a method.
Given the following declarations:enum Days { Mon, Tue, Wed,…
Given the following declarations:enum Days { Mon, Tue, Wed, Thur, Fri, Sat };Days day1 = Days.Tue;int n = 3;The following Boolean expression is valid:day1 < n
If two methods have the same names and parameter lists, you…
If two methods have the same names and parameter lists, you cannot overload them by just giving them different return types.
The set accessor is executed any time that a property is rea…
The set accessor is executed any time that a property is read.
Constructors cannot be overloaded which means a class can on…
Constructors cannot be overloaded which means a class can only have one constructor.
In code that creates an instance of a class, you access the…
In code that creates an instance of a class, you access the class object’s properties in the same way that you would access public variables.