Chapter 5: Classes Part 2
Learning Objectives
By the end of this chapter, you should understand:
- How to customize fields with the keywords
readonlyandstatic. - How to add methods to a class and call those methods.
- The difference between instance methods and static methods.
- How to override the default
ToStringandEqualsmethods for a class. - How to auto-generate an
Equalsmethod in Visual Studio.
Key Terminology
Customizing Fields
readonlyfieldstaticfieldconst
Customizing Methods
staticmethod- Class method
Special Methods
overrideToStringmethod- Overriding
- Cast
- Equality
- Identity
Equalsmethod