Chapter 3. Class Design in C#

Topics in This Chapter

  • Defining a ClassThe attributes and modifiers included in a class definition influence the behavior and accessibility of the class.

  • ConstantsA const type defines fixed values at compilation time.

  • FieldsA field is typically used to maintain data inside a class.

  • PropertiesA property is the recommended way to expose a class's data.

  • MethodsThe functionality of a class is defined by its methods.

  • InheritanceBy using inheritance, a class can take advantage of preexisting types.

  • ConstructorsThis special purpose method is used to initialize a class.

  • Events and DelegatesA program's actions are often triggered by events; delegates have the role of invoking methods to handle an event.

  • Operator Overloading ...

Get Core C# and .NET now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.