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.

c.XyzCallback = null<br />

This will reset all your delegates to nothing and you have to keep figuring where the error<br />

is.<br />

(B) If we inherit a class do the private variables also get<br />

inherited ?<br />

Yes the variables are inherited but can not be accessed directly by the class interface.<br />

(B) What are different accessibility levels defined in .<strong>NET</strong> ?<br />

Following are the five levels of access modifiers :-<br />

√<br />

√<br />

√<br />

√<br />

√<br />

Private : Only members of class have access.<br />

Protected :-All members in current class and in derived classes can access the<br />

variables.<br />

Friend (internal in C#) :- Only members in current project have access to the<br />

elements.<br />

Protected friend (protected internal in C#) :- All members in current project<br />

and all members in derived class can access the variables.<br />

Public :- All members have access in all classes and projects.<br />

(I) Can you prevent a class from overriding ?<br />

If you define a class as “Sealed” in C# and “NotInheritable” in VB.<strong>NET</strong> you can inherit<br />

the class any further.<br />

(I) What’s the use of “MustInherit” keyword in VB.<strong>NET</strong> ?<br />

If you want to create a abstract class in VB.<strong>NET</strong> it’s done by using “MustInherit”<br />

keyword.This acts only as base type and can not be inherited any further.You can not<br />

create a object of a class which is marked as “MustInherit”.<br />

110<br />

*What have your learnt from your past project experiences ?

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

Saved successfully!

Ooh no, something went wrong!