Classes Part 2
Learning Objectives
By the end of this chapter, you should understand:
- How to customize fields with the keywords
readonly
andstatic
. - How to add methods to a class and call those methods.
- The difference between instance methods and static methods.
- How to override the default
ToString
andEquals
methods for a class. - How to auto-generate an
Equals
method in Visual Studio.
Key Terminology
Customizing Fields
readonly
fieldstatic
fieldconst
Customizing Methods
static
method- Class method
Special Methods
override
ToString
method- Overriding
- Cast
- Equality
- Identity
Equals
method