Working with Objects
摘要
Remember when we talked about how programming is largely concerned with organizing and manipulating data? We interact with data as objects. A single piece of data is called an object, and an object might have other objects stored inside it – as we described in our previous examples, a data type resembling a “Person” might have a first name, last name, date of birth, and so on. We’ve already dealt with some basic objects: bool, int, float, and string are all objects as well. Now let’s learn about creating our own objects and dealing with other, less basic types of data.