TCS Questions on Polymorphism

1.Which of the following is not a valid type of polymorphism?
a.adhoc polymorphism
b.imperative polymorphism
c.predicative polymorphism
d.inclusion polymorphism
Answer:b

2.What is the function used to describe the situation, when a function in base class is redefined in inherited class?
a.Inheritance
b.Overriding
c.Overloading
d.Encapsulation
Answer:b

3.How can a call to an overloaded function be ambiguous?
a.By misspelling the name
b.There might be two or more functions with the same name
c.There might be two or more functions with equally appropriate signatures
d.None of these
Answer:b

4.A complete binary tree with the property that the value at each node is at least as large as the values at its children is known as
a.Binary search tree
b.AVL tree
c.Completely balanced tree
d.Heap
Answer:d
Exp:A max-heap is a complete binary tree in which the value in each internal node is greater than or equal to the values in the children of that node.

5.Which of the following correctly describes overloading of functions?
a.Virtual polymorphism
b.Transient polymorphism
c.Ad-hoc polymorphism
d.Pseudo polymorphism
Answer:c

6.Which of the following operator is overloaded for object cout?
a.>>
b.<< c.+ d.= Answer:a 7.Which of the following operators cannot be overloaded? a.[] b.->
c.?:
d.*
Answer:d

8.Which of the following is a mechanism of static polymorphism?
a.Operator overloading
b.Function overloading
c.Templates
d.All of the above
Answer:d

9.Which of the following keyword is used to overload an operator?
a.Overload
b.Operator
c.Friend
d.Override
Answer:b

10.The operator << when overloaded in a class a.must be a member function b.must be a non member function c.can be both (A) & (B) above d.cannot be overloaded Answer:c