Understanding Classes

Classes enable you to develop applications using object-oriented programming (OOP) techniques. Classes are templates that define objects. Although you may not have known it, you have been programming with classes throughout this book. When you create a new form in a Visual C# .NET project, you are actually creating a class that defines a form; forms instantiated at runtime are derived from the class. Using objects derived from predefined classes (such as a Visual C# .NET Form class), is just the start of enjoying the benefits of object-oriented programming—to truly realize the benefits of OOP, you must create your own classes.

The philosophy of programming with classes is considerably different from that of “traditional” ...

Get Sams Teach Yourself Microsoft® Visual C#™ .NET in 24 Hours now with O’Reilly online learning.

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