CHAPTER 6

image

Member Accessibility and Overloading

One of the important decisions to make when designing an object is how accessible to make the members. In C#, accessibility can be controlled in several ways.

Class Accessibility

The coarsest level at which accessibility (also known as visibility) can be controlled is at the class. In most cases, the only valid modifiers on a class are public, which means that everybody can see the class, and internal. The exception to this is nesting classes inside of other classes, which is a bit more complicated and is covered in Chapter 7.

Internal is a way of granting access to a wider set of classes without ...

Get A Programmer's Guide to C# 5.0, 4th Edition now with O’Reilly online learning.

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