Chapter 8 Flashcards
Is public member functions, the interface of class
Yes
What is the purpose of scope resolution operator
If we declare function inside class and define it outside class then we use scope resolution operator. it’s symbol is ::
What is inline function
Inline function is fastly executed. If we define a function inside class, its default semantic is inline. Keyword ‘inline’ is used to request compiler to make a function inline. e.g.
inline int Area() {
…
}
What is constructor
Constructor is used to initialized the objects of class. Constructor is automatically called when the object is created. It does not have return type.
What is default constructor
Such a constructor that do not have parameters is called default constructor.
What is overloaded constructor
Constructor can have parameters and it is called constructor overloading.
What is copy constructor
The copy constructor is a constructor which creates an object by initializing it with an object of the same class, which has been created previously. e.g. class Line { public: int getLength( void ); Line( int len ); // simple constructor Line( const Line &obj); // copy constructor ~Line(); // destructor
private:
…
};
What is shallow copy
Copying constructor is called shallow copy