C++ Programming :: Virtual Function

NA
SHSTTON
6
Solv. Corr.
2
Solv. In. Corr.
8
Attempted
0 M:0 S
Avg. Time

1 / 6

Choose the correct option.

A virtual function that has no definition within the base class is called____________.


APure virtual function

BPure static function

CPure Const function

DFriend function

Answer: Option A

Explanation:

Here is no explanation for this answer

Workspace

NA
SHSTTON
6
Solv. Corr.
3
Solv. In. Corr.
9
Attempted
0 M:0 S
Avg. Time

2 / 6

Choose the correct option.

If a class contains pure virtual function, then it is termed as____________________ .


AVirtual class

BSealed class

CPure Local class

DAbstract Class

Answer: Option D

Explanation:

Here is no explanation for this answer

Workspace

NA
SHSTTON
7
Solv. Corr.
4
Solv. In. Corr.
11
Attempted
0 M:0 S
Avg. Time

3 / 6

Choose the correct option.

Which of the followings are true about Virtual functions?


AThey must be non-static member function of the class

BThey cannot be friends

CConstructor Functions cannot be virtual

DAll of these

Answer: Option D

Explanation:

Here is no explanation for this answer

Workspace

NA
SHSTTON
6
Solv. Corr.
4
Solv. In. Corr.
10
Attempted
0 M:0 S
Avg. Time

4 / 6

Choose the correct option.

Syntax for Pure Virtual Function is ______________ .


Avirtual void show()==0

Bvoid virtual show()==0

Cvirtual void show()=0

Dvoid virtual show()=0

Answer: Option C

Explanation:

Here is no explanation for this answer

Workspace

NA
SHSTTON
10
Solv. Corr.
0
Solv. In. Corr.
10
Attempted
0 M:0 S
Avg. Time

5 / 6

Choose the correct option.

_______________ is a member function that is declared within a base class and redefined by derived class.


Avirtual function

Bstatic function

Cfriend function

Dconst member function

Answer: Option A

Explanation:

Here is no explanation for this answer

Workspace

NA
SHSTTON
2
Solv. Corr.
8
Solv. In. Corr.
10
Attempted
0 M:0 S
Avg. Time

6 / 6

Choose the correct option.

Which of the following keyword supports dynamic method resolution?


Aabstract

BVirtual

CDynamic

DTypeid

Answer: Option A

Explanation:

Here is no explanation for this answer

Workspace