6 Writing Custom Classes
“The law is the abstract expression of the general will being in and of itself.”—Georg Wilhelm Friedrich Hegel (1770–1831)
In the preceding chapters, you learned a lot about object orientation, but our discussion was more from the user point of view. You’ve seen how objects can be built, and we’ve also implemented simple classes with static methods. Now is the time to round out your knowledge of object-oriented programming (OOP) and build your own custom data types .
[»] Note
We’ll illustrate the concepts of object orientation with a program based on the Drug Wars game. John Dell developed this MS-DOS-based game in the early 1980s to demonstrate a core principle of economics: buy low and sell high. With easy-to-understand ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access