You are on page 1of 1

Q1 (a) What is polymorphism? What are the difference between compile time and run time polymorphism?

Polymorphism is the ability to use an operator or method in different ways. Polymorphism refers to codes, operations or objects that behave differently in different contexts. C++ provides three different types of polymorphism.

run-time (Also called as Runtime binding.) compile-time (Also called as static binding) ad-hoc polymorphism parametric polymorphism

(b) Explain different types of data types with example. (c) What is virtual base class? How do you pass base class constructors in the derived class? When two or more objects are derived from a common base class, we can prevent multiple copies of the base class being present in an object derived from those objects by declaring the base class as virtual when it is being inherited. Such a base class is known as virtual base class. This can be achieved by preceding the base class name with the word virtual.

You might also like