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.

Figure :- 6.6 Shadowing in Action<br />

(A) What’s difference between Shadowing and Overriding ?<br />

Following are the differences between shadowing and overriding :-<br />

√<br />

√<br />

Overriding redefines only the implementation while shadowing redefines the<br />

whole element.<br />

In overriding derived classes can refer the parent class element by using “ME”<br />

keyword , but in shadowing you can access it by “MYBASE”.<br />

(I) What’s difference between delegate and events?<br />

√<br />

√<br />

Actually events use delegates in bottom. But they add an extra layer on the<br />

delegates, thus forming the publisher and subscriber model.<br />

As delegates are function to pointers they can move across any clients. So any<br />

of the clients can add or remove events , which can be pretty confusing. But<br />

events give the extra protection by adding the layer and making it a publisher<br />

and subscriber model.<br />

Just imagine one of your clients doing this<br />

*Have you ever been fired or forced to resign?<br />

109

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

Saved successfully!

Ooh no, something went wrong!