You make a new type by declaring a class. A class is a collection of variables—often of different types—combined with a set of related functions.
One way to think about a car is as a collection of wheels, doors, seats, windows, and so forth. Another way is to think about what a car can do: It can move, speed up, slow down, stop, park, and so on.
Encapsulation is bundling together all the information, capabilities, and responsibilities of an entity into a single object.
Encapsulating everything you know about a car into one class ...