You are on page 1of 2

1

T. Y. B. Sc. IT
SEMESTER VI
Chap 15 Test
Time 20 Min Total
20 Marks
Students Name: ____________________________________________
Roll No:
Write the proper
a) can be
11 What operator overloading is necessary?
match
overloaded
1)
_______________________________
1. : operator : ______
b) must be in pair
________
2. Unary bitwise : ____
c) take no argument
________________________________________
3. Comparison Opr :___ d) Not allowed
2)
_______________________________
4. Operator
e) One name many
_________
overloading : __
form
________________________________________
2 Restrictions for comparison operator
12 Two rules for operating overloading
overloading
1)
____________________________________
1) __________________________________________
__________________________________________
___________________________________________ 2)
2) _______________________________________
__________________________________________
_________________________________________
___________________________________________
List 4 types of operator that cannot be
13 Comment on compound arithmetic opr
overloaded
overloading
___________________________________________
____________________________________________
___________________________________________
____________________________________________
Applications of operator
14 List four types of overloadble operators
overloading._______________
1>________________ 5> ___________________
______________________________________________
2>_________________ 4>____________________
______________________________________________
State whether the statements are true or
15 Define an overloaded * operator for
false
Complex product that returns an integer
1) Operator overloading allow to define new
value: class Complex{
operator__
2) Class can overload operator for other class.
______
3) Overloaded operator must be static. _____
4) Ternary operator can be overloaded ____
Comment on rules for binary operator
overloading _____
}
______________________________________________
______________________________________________
General syntax for declaring a operator
16 Define operator
method
overloading_____________________
____________________________________________
why the following declarations are
17 Two differences between operator
invalid: class MyInt{ bool isRect = true; int
&
overloading in C++ and operator
n=10;
18 overloading in C#._________________
public static int operator *=(MyInt mi1)
____________________________________________
{ return mi1.n++; }
____________________________________________
__________________________________ public
____________________________________________
static bool operator *(MyInt r1, bool r2)
____________________________________________
{boolean b = r1.isRect && r2; return b; }
____________________________________________
________________________________
______________________________________________

9
&
1
0

Write a prototype for real world method for


following: 1) an non comparison operator
taking two parameter and returning boolean
value.______________________
______________________________________________
2) a binary operator taking an object and
scalar value and returning
object______________________________
______________________________________________

19

20

Write an prototype of operator methods to


perform the following: Doremon d1 = new
Doremon(10); d1 *= (new (Doremon)
<= 99); _______________________
____________________________________________
____________________________________________
____________________________________________
____________________________________________

Marks Obtained __________ in Words ___________________________ Signature of the


Examiner________

You might also like