September 2014
Intermediate to advanced
396 pages
7h 58m
English
CHAPTER 10
![]()
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 ...
Read now
Unlock full access