Lecture 13
Recap
Separation of Interface and Implementation
Objects are Declared as Primitive Type
The Destructor Operator
Copy Constructor
Default Constructor
Selective Questions from
Exercise
Q: What is information hiding? What is encapsulation?
How does C++ support these concepts?
Answer:
Information hiding makes implementation details,
including components of an object, inaccessible.
Encapsulation is the grouping of data and the
operations that apply to them to form an aggregate
while hiding the implementation of the aggregate.
Encapsulation and information hiding are achieved
in C++ through the use of the class.
Q: Explain the public and private sections of the class.
Answer:
Members in the public section of a class are visible
to non-class routines and can be accessed via the.
member operator. Private members are not visible
outside of the class.