O'Reilly logo

C++ 2013 for C# Developers,Second Edition by Dean C. Wills

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

CHAPTER 10

image

Properties and Events

Annual income twenty pounds, annual expenditure nineteen nineteen six, result happiness. Annual income twenty pounds, annual expenditure twenty pound ought and six, result misery.

—Charles Dickens, David Copperfield

Properties were created to provide field-like functionality for data in a context that allows the programmer to either access the data or abstract the data in an entirely different fashion than is provided by the type system.

Normal fields are simple type declarations within a class. A property contains a method for retrieving data called a getter, a method for storing data called a setter, or both ...

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