Chapter 8 Flashcards

1
Q

Is public member functions, the interface of class

A

Yes

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is the purpose of scope resolution operator

A

If we declare function inside class and define it outside class then we use scope resolution operator. it’s symbol is ::

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is inline function

A

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() {

}

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is constructor

A

Constructor is used to initialized the objects of class. Constructor is automatically called when the object is created. It does not have return type.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is default constructor

A

Such a constructor that do not have parameters is called default constructor.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is overloaded constructor

A

Constructor can have parameters and it is called constructor overloading.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is copy constructor

A
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:

};

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is shallow copy

A

Copying constructor is called shallow copy

How well did you know this?
1
Not at all
2
3
4
5
Perfectly