Section 17.13 Vocabulary
- composition:
- An object that can be modified at any time. Points and rectangles are mutable by design.
- has a:
- A relationship between objects where one object has a member that is another object. Composition is a form of a has-a relationship.
- initializer list:
- Instructions that proceed constructorβs body that control how object memory is initialized. It can be used to prevent default constructor calls being used to initialize composed members.
- copy constructor:
- A special constructor used to copy an object when we write something like
Point p2(p1)
(wherep1
is an existing point). Every class automatically has a copy constructor that copies all of the data from the source object to the new one. - static members:
- Static members of a class are βsharedβ. All instances of a class share one copy of any static member variables. Static member functions can only access static member variables and can be called directly on the class using
ClassName::function()
syntax.
You have attempted of activities on this page.