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 the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.