Until now, we've mostly talked about working with predefined types, such as
String. However, it is often convenient to define new data types that represent more complex concepts than just numbers or strings. When we are writing an order-tracking program, for example, it may be convenient to define a type that represents a customer. The customer type would include information about each customer who has opened an order: the customer's name, the customer's address, the customer's phone number, and so on.
This chapter discusses classes and structures that can be used to define just these kinds of types.
Before we jump into classes and structures, however, it is necessary to take a step back ...