If a class’s properties have set accessors, the class is probably immutable.
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());
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.
The following statement will cause a compiler error:int numb…
The following statement will cause a compiler error:int number = null;
The class header defines a class’s fields, properties, and m…
The class header defines a class’s fields, properties, and methods.
If you try to pass a property to a ref or an out parameter,…
If you try to pass a property to a ref or an out parameter, an error occurs.
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.
Objects that are instances of a class cannot be stored in an…
Objects that are instances of a class cannot be stored in an array.
In C#, you are not allowed to use an uninitialized class fie…
In C#, you are not allowed to use an uninitialized class field.
To make a property read-only, you must omit the get accessor…
To make a property read-only, you must omit the get accessor for the property.