Which among the following is correct for abstract methods?

Phạm Quyết

New member
Which among the following is correct for abstract methods?
A. It must have different prototype in the derived class
B. It must have same prototype in both base and derived class
C. It must have different signature in derived class
D. It must have same return type only
 
Answer: b
Explanation: The prototype must be the same. This is to override the function declared as abstract in base class. Or else it will not be possible to override the abstract function of base class and hence we get a compile time error.
 

Tìm kiếm

Back
Top