C++ Programming :: Virtual Function

Home > C++ Programming > Virtual Function > General Questions

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

1 / 6

 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
0
Solv. Corr.
0
Solv. In. Corr.
0
Attempted
0 M:0 S
Avg. Time

2 / 6

 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
0
Solv. Corr.
0
Solv. In. Corr.
0
Attempted
0 M:0 S
Avg. Time

3 / 6

 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
0
Solv. Corr.
0
Solv. In. Corr.
0
Attempted
0 M:0 S
Avg. Time

4 / 6

 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
0
Solv. Corr.
0
Solv. In. Corr.
0
Attempted
0 M:0 S
Avg. Time

5 / 6

 _______________ 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
0
Solv. Corr.
0
Solv. In. Corr.
0
Attempted
0 M:0 S
Avg. Time

6 / 6

 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