A class is a non-primitive or user-defined data type in C++, while an object is an instance of a class. A class is a collection of a fixed number of components. The components of a class are called the members of the class. For example: in real life, a car is an object. The car has attributes, such as weight and color, and methods, such as drive and brake. A Class is like an object constructor, or a "blueprint" for creating objects.
\uD83D\uDCD8 Learning Objective
Learn about classes
Learn about private, protected, and public members of a class
Explore how classes are implemented
Become aware of accessor and mutator functions
Examine constructors and destructors
Learn about the abstract data type (ADT)
Explore how classes are used to implement ADTs
Learn about information hiding
Explore how information hiding is implemented in C++
Learn about the static members of a class
Info |
---|
Chapter 10 introduces a structured data type called a class, which is specifically designed to group data and functions. After examining its structure, students will learn how to create and use classes. The typical members of a class will be discussed, including accessors, mutators, constructors, and destructors. We will define the properties of these members, such as private, protected, public, and static. Students will also learn about abstract data types and how classes are used to implement them. In the process, they will be introduced to the concept of information hiding. Finally, we will discuss information hiding as implemented in C++. |
\uD83D\uDCCB Assignments
Read Chapter (10.1 to 10.6)
Review Class notes (Evernotes Pages)
Complete Complete Quiz
Complete Lab 1, 2 and 3
...