Head First C# Code: Chapter 5, Encapsulation

Chapter 5 Opening Image

Ever wished for a little more privacy?

Head First C#

Sometimes your objects feel the same way. Just like you don't want anybody you don't trust reading your journal or paging through your bank statements, good objects don't let other objects go poking around their fields. In this chapter, you're going to learn about the power of encapsulation. You'll make your object's data private, and add methods to protect how that data is accessed.

Download the Code