Topic: Chapter 15: Polymorphism (Test 1)



Topic: Chapter 15: Polymorphism
Q.1
The mechanism of giving special meaning to an operator is known as
A. Function Overloading
B. Operator overloading
C. Constructor overloading
D. Member overloading
Answer : Option B
Explaination / Solution:
No Explaination.


Workspace
Report
Q.2
Provides flexibility of creating multiple type of objects for a class.
A. Function Overloading
B. Operator overloading
C. Constructor overloading
D. Member overloading
Answer : Option C
Explaination / Solution:
No Explaination.


Workspace
Report
Q.3
Which of the following operator is overloaded?
A. +
B. operator
C. ::
D. =
Answer : Option D
Explaination / Solution:
No Explaination.


Workspace
Report
Q.4
Which of the following refers to a function having more than one distinct meaning?
A. Function Overloading
B. Member overloading
C. Operator overloading
D. Operations overloading
Answer : Option A
Explaination / Solution:
No Explaination.


Workspace
Report
Q.5
Which of the following reduces the number of comparisons in a program ?
A. Operator overloading
B. Operations overloading
C. Function Overloading
D. Member overloading
Answer : Option C
Explaination / Solution:
No Explaination.


Workspace
Report
Q.6

void dispchar(char ch=’$’,int size=10)

{

for(int i=1;i<=size;i++)

cout<<ch;

}

How will you invoke the function dispchar() for the following input?

To print $ for 10 times

A. dispchar();
B. dispchar(ch,size);
C. dispchar($,10);
D. dispchar(‘$’,10 times);
Answer : Option C
Explaination / Solution:
No Explaination.


Workspace
Report
Q.7
Which of the following is not true with respect to function overloading?
A. The overloaded functions must differ in their signature.
B. The return type is also considered for overloading a function.
C. The default arguments of overloaded functions are notconsidered for Overloading.
D. Destructor function cannot be overloaded.
Answer : Option B
Explaination / Solution:
No Explaination.


Workspace
Report
Q.8
Which of the following is invalid prototype for function overloading
A.

void fun (intx);

void fun (char ch) ;
B.

void fun (intx);

void fun (inty);

C.

void fun (double d);

void fun (char ch);
D.

void fun (double d);

void fun (inty);
Answer : Option B
Explaination / Solution:
No Explaination.


Workspace
Report
Q.9

Which of the following function(s) combination cannot be considered as

overloaded function(s) in the given snippet ?

void print(char A,int B); // F1

void printprint(int A, float B); // F2

void Print(int P=10); // F3

void print(); // F4

A. F1,F2,F3,F4
B. F1,F2,F3
C. F1,F2,F4
D. F1,F3,F4
Answer : Option D
Explaination / Solution:
No Explaination.


Workspace
Report
Q.10
Which of the following operator is by default overloaded by the compiler?
A. *
B. +
C. +=
D. =
Answer : Option D
Explaination / Solution:
No Explaination.


Workspace
Report