Only methods in a derived class can directly access the base class’s private members.
Blog
You can think of a derived class as an extended version of s…
You can think of a derived class as an extended version of some base class.
Assume you have written a ToString method in a class, and cr…
Assume you have written a ToString method in a class, and created an instance of the class named object1. The following two statements are equivalent:MessageBox.Show(object1);MessageBox.Show(object1.ToString());
A method can return a primitive value or a struct object, bu…
A method can return a primitive value or a struct object, but it cannot return an object that is an instance of a class.
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.