26.02.2015 Views

DOT NET Interview Questions - DotNetSpider

DOT NET Interview Questions - DotNetSpider

DOT NET Interview Questions - DotNetSpider

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

(I) Why can not you specify accessibility modifier in<br />

Interface ?<br />

All elements in Interface should be public.So by default all interface elements are public<br />

by default.<br />

(A) What are similarities between Class and structure ?<br />

Following are the similarities between classes and structures :-<br />

√<br />

√<br />

√<br />

√<br />

Both can have constructors, methods, properties, fields, constants,<br />

enumerations, events, and event handlers.<br />

Structures and classes can implement interface.<br />

Both of them can have constructors without parameter and with parameter.<br />

Both can have delegates and events.<br />

(A) What’s the difference between Class and structure’s ?<br />

Following are the key differences between them :-<br />

√<br />

√<br />

√<br />

√<br />

Structure are value types and classes are reference types.So structures use<br />

stack and classes use heap.<br />

Structures members can not be declared as protected , but class members can<br />

be.You can not do inheritance in structures.<br />

Structures do not require constructors while classes require.<br />

Objects created from classes are terminated using Garbage collector.Structures<br />

are not destroyed using GC.<br />

(B) What does virtual keyword mean ?<br />

That method and property can be overridden.<br />

(B) What are shared (VB.<strong>NET</strong>)/Static(C#) variables?<br />

Static/Shared classes are used when a class provides functionality which is not specific to<br />

any instance.In short if you want a object to be shared between multiple instances you<br />

will use a static/Shared class.<br />

*What's the logic of link list ?<br />

111

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

Saved successfully!

Ooh no, something went wrong!