Click here to hide categories Click here to show left categories

User: Home          welcome : Guest          Log In / Register here     




.NET interview questions: -Similarities/Differences between Classes and structures.

One of the most likely .NET interview questions asked in the interview, so you should include the following points in your answers.

Similarities between classes and structures: -

  • Both can have constructors, methods, properties, fields, constants, enumerations, events, and event handlers.
  • Structures and classes can implement interface.
  • Both of them can have constructors with and without parameter.

Both can have delegates and events.

Key differences are: -

  • Structures are value types and classes are reference types. So structures use stack and classes use heap.
  • Structures members cannot be declared as protected, but class members can be. You cannot do inheritance in structures.
  • Structures do not require constructors while classes require.
  • Objects created from classes are terminated using Garbage collector. Structures are not destroyed using GC.

Following you can see video on regular expressions with some practical demonstrations: -

Please click here to see more .NET interview questions

Regards,

Visit Authors blog for more .NET interview questions

Share this article   |    Print    |    Article read by 3616 times
Author:
Shivprasad koirala Koirala
I am a Microsoft MVP for ASP/ASP.NET and currently a CEO of a small E-learning company in India. We are very much active in making training videos , writing books and corporate trainings. Do visit my site http://www.questpond.com for .NET, C# , design pattern , WCF , Silverlight , LINQ , ASP.NET , ADO.NET , Sharepoint , UML , SQL Server training and Interview questions and answers
Related Articles: No related article
Related Interview Questions: No related interview question