26.02.2015 Views

DOT NET Interview Questions - DotNetSpider

DOT NET Interview Questions - DotNetSpider

DOT NET Interview Questions - DotNetSpider

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

(I) Do events have return type ?<br />

No events do not have return type.<br />

(A) Can event’s have access modifiers ?<br />

Event’s are always public as they are meant to serve every one registering to it.But you<br />

can access modifiers in events.You can have events with protected keyword which will<br />

be accessible only to inherited classes.You can have private events only for object in that<br />

class.<br />

(A) Can we have shared events ?<br />

Yes you can have shared event’s note only shared methods can raise shared events.<br />

(I) What is shadowing ?<br />

When two elements in a program have same name , one of them can hide and shadow the<br />

other one.So in such cases the element which shadowed the main element is referenced.<br />

Below is a sample code , there are two classes “ClsParent” and “ClsShadowedParent”.In<br />

“ClsParent” there is a variable “x” which is a integer.”ClsShadowedParent” overrides<br />

“ClsParent” and shadows the “x” variable to a string.<br />

Note:- In Sample CD “WindowsShadowing” is folder which has the sample code.If you<br />

run the program you can have two output’s one which shows a integer and other which shows<br />

a string.<br />

Public Class ClsParent<br />

Public x As Integer<br />

End Class<br />

Public Class ClsShadowedParent<br />

Inherits ClsParent<br />

Public Shadows x As String<br />

End Class<br />

108<br />

* Why should i hire you ?

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!