You are on page 1of 4

1

2
&
3
&
4
&
1
2

8
&
9

1
0

T. Y. B. Sc. IT
SEMESTER VI
Chap 16 Test
Time 20 Min Total 20
Marks
Students Name: ____________________________________________
Roll No:
Write the proper
a) All returns void
11 State whether the statements are true or
match
b) System.Console
&
false
1. Callable entity :
c) take no
12 1) Delegates can be used as base by derive
______
argument
class _____
2. callbacks : ____
d) Events
2) Delegates can be inherited by base class.
3. Multicast :___
e) Delegate
______
4. Err:________
methods
3) Events are of value type. _____
4) Non static methods can not be used in
delegate___
Complete & comment on the following
13 ___________________________________________
code snippet : Using System;
___________________________________________
class A{internal delegate void
___________________________________________
MyDel(string);}
____________________________________________
class B:A{internal _____delegate void
__________________________________________
MyDel(string);
___________________________________________
public B(){MyDel md = new
MyDel(Console.Write);} }
class test {public static void Main(){B obj =
new B(); obj.md(Hello);}}
List 4 types of operator that cannot be
14 Three places where delegates can be
overloaded
declared: 1) ____ _________________________
___________________________________________
2)_________________
___________________________________________
3)__________________________________________
_
2 Advantages of using
delegates___________________
_____________________________________________
_____________________________________________
General syntax for declaring a delegate
15 Define delegates_________
_____________________
____________________________________________
List four steps of using delegates
16 All delegates are of __________ type and
1>__________________________________________
represents ____________________ class.
_
2>__________________________________________
_
3>_________________________________________
__
4>__________________________________________
_
What are
17 Two restrictions for using Multicast
events_______________________________
&
delegates. 1) ____
____________________________________________
18 ____________________________________________
2)__________________________________________
_

1
9
&
2
0

Write two methods to map the delegate to


use multicast delegate.
public delegate void onedel(int , string)

20

Marks Obtained __________ in Words ___________________________ Signature of the


Examiner________

Akbar Peerbhoy College of Commerce and Economics


T. Y. B. Sc. IT
SEMESTER VI
Chap 14 Test
Time 20 Min Total 20
Marks Date: 23rd Feb 2012
Students Name: ____________________________________________ Roll
No:
1

6
7

f) Constant_____________
g) Array_______________
h) abstract method_______
i) Copy Constructor_____
j) Property.____________
2 Differences between classes and Interface methods
1) __________________________________________
___________________________________________
2) __________________________________________
___________________________________________
List 4 modifiers that can used with interface methods
___________________________________________
___________________________________________

11

Use of as keyword
___________________________________________
___________________________________________
State whether the statements are true or false
5) interface cannot have non static member. _____
6) interface is value type. ______
7) Interface can have a property with get set ____
8) Multilevel inheritance is not allowed in Interface___
9) Two interfaces cannot use same base interface ____
Use of : (colon) in class for interface

14

16

______________ & _________ modifiers cannot be


used with interface members.

General syntax for declaring a class that implements an


interface and a class

17

General syntax of using a property in interface

Mark
V for valid
I for invalid
Member of interface

12

13

15

Interface to class type conversion.


____________________________________________
___________________________________________
__ __________________________________________
___________________________________________
2 advantages of abstract class over interface
1) ____________________________________
____________________________________
2) ____________________________________
____________________________________
When will u apply multiple interface implementation.
___________________________________________
___________________________________________
When will u apply explicit interface implementation.
___________________________________________
___________________________________________
interface a{void show();}
interface b:a{void
show();}
interface C:b{void show();}
create a class that implements C

8
&
18

Comment on the following code snippet :


interface Mobile {void show();}__________________
class Nokia:Mobile{void show(){}}_______________
Mobile m[] = new Mobile[10] ___________________
For(i=0;i<10;i++) m[i] = (Mobile) new Nokia()______

9
&
19

correct & Rewrite the code


interface a{private void aa() }
struct b:a{public void aa(){}}
class test : b {
public static void Main(){
aa(); }}
How an interface is use to call a its own method

10

____________________________________________
____________________________________________
____________________________________________
____________________________________________
____________________________________________
19

____________________________________________
____________________________________________
____________________________________________
____________________________________________
____________________________________________

20

Similarities in classes and interfaces


1)__________________________________________
2)___________________________________________

Marks Obtained __________ in Words ___________________________ Signature of the


Examiner______________

Akbar Peerbhoy College of Commerce and Economics

T. Y. B. Sc. IT
SEMESTER VI
Chap 15 Test
Time 20 Min Total 20
rd
Marks Date: 23 Feb 2012
Students Name: ____________________________________________
Roll No:
Write the proper
k) can be
11 What operator overloading is necessary?
match
overloaded
1)
_______________________________
1. : operator :
l) must be in pair
________
______
m)
take no
________________________________________
2. Unary bitwise : ____
argument
2)
_______________________________
3. Comparison Opr :___ n) Not allowed
_________
4. Operator
o) One name many
________________________________________
overloading : __
form
2 Restrictions for comparison operator
12 Two rules for operating overloading
overloading
2)
____________________________________
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>____________________
______________________________________________

9
&
1
0

State whether the statements are true or


false
10)
Operator overloading allow to define
new operator__
11)
Class can overload operator for other
class. ______
12)
Overloaded operator must be static.
_____
13)
Ternary operator can be overloaded
____
Comment on rules for binary operator
overloading _____
______________________________________________
______________________________________________
General syntax for declaring a operator
method

15

why the following declarations are


invalid: class MyInt{ bool isRect = true; int
n=10;
public static int operator *=(MyInt mi1)
{ return mi1.n++; }
__________________________________ public
static bool operator *(MyInt r1, bool r2)
{boolean b = r1.isRect && r2; return b; }
________________________________
______________________________________________
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______________________________
______________________________________________

17
&
18

Define an overloaded * operator for


Complex product that returns an integer
value: class Complex{

16

19

20

Define operator
overloading_____________________
____________________________________________
Two differences between operator
overloading in C++ and operator
overloading in C#._________________
____________________________________________
____________________________________________
____________________________________________
____________________________________________
____________________________________________

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