Our website is made possible by displaying online advertisements to our visitors. Please consider supporting us by whitelisting our website.

OOPs Concepts

Cpp Programming 67 – How many types of polymorphisms are supported by C++?

Question: How many types of polymorphisms are supported by C++?
[A]. 1
[B]. 2[C]. 3
[D]. 4

Answer: Option B

Explanation:

The two main types of polymorphism are run-time (implemented as inheritance and virtual functions), and compile-time (implemented as templates).

Cpp Programming 67 – How many types of polymorphisms are supported by C++? Read More »

Cpp Programming, OOPs Concepts

Cpp Programming 70 – Which one of the following is the correct way to declare a pure virtual function?

Question: Which one of the following is the correct way to declare a pure virtual function?
[A]. virtual void Display(void){0};
[B]. virtual void Display = 0;[C]. virtual void Display(void) = 0;
[D]. void Display(void) = 0;

Answer: Option C

Cpp Programming 70 – Which one of the following is the correct way to declare a pure virtual function? Read More »

Cpp Programming, OOPs Concepts