16 Objects, Data Classes, and Enums
In the last three chapters, you learned how to use object-oriented programming principles to build meaningful relationships between objects.
Despite the variety of ways they can be initialized, all the classes that you have worked with thus far have been declared with the same class keyword.
This chapter introduces object declarations as well as other types of classes: nested classes, data classes, and enum classes.
As you will see, each has its own declaration syntax and unique characteristics.
By the end of this chapter, your hero will be able to walk from room to room around the world of NyetHack – and your program will be well organized to support the enhancements coming in later chapters. ...
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