O'Reilly logo

Start Here!™ Fundamentals of Microsoft® .NET Programming by Rod Stephens

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Class Benefits

The biggest benefit of classes is encapsulation, the ability to group the class’s properties and methods in a convenient package. A class groups the features that define a single object or concept, such as Customer, Student, or AnnualReport.

A well-designed class encapsulates the features needed to control its main concept and nothing else. For example, a Student class should store information about a student. Although it should provide a way to see what courses the student is taking, it should not store detailed information about those courses—that would be the job of a Course class.

Strong encapsulation hides the details of how the class works from outside code. It isolates the rest of the program from those details, so a programmer ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required