10. Classes and Objects: A Deeper Look
Objectives
In this chapter you’ll:
Use composition to allow a class to have references to objects of other classes as members.
Throw an exception to indicate that an argument is out of range.
Enable an object to refer to itself with the keyword this
.
Use static
variables and methods.
Use readonly
fields.
Get C# 6 for Programmers, Sixth Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.