.Net Interview Questions and Answers

Search:

.NET interview questions: - What are similarities and differences between Classes and structures?

By : Shiv Prasad Koirala | Nov 25th, 2011 | Views : 646 | Comments : 0 Bookmark and Share

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 Most asked Dotnet interview questions
 

Regards,

 

Visit Authors blog for more Dotnet interview questions and answers

 
Rate this Article :
1 Star
2 Stars
3 Stars
4 Stars
5 Stars
1 1 1 2 1
 
 
 
 

WCF Interview questions and answers: -What is the difference between WCF fault exceptions and normal .NET exceptions?

In this article we will show difference between WCF fault exceptions and normal .NET exceptions. For more articles and videos visit us on http://www.questpond.com/... Read More

.NET interview questions: - Can you elaborate project life cycle?

In this article we will explain about project life cycle. For more articles and videos visit us on http://www.questpond.com/... Read More

WCF Interview questions:- Which binding do we need to use for WCF REST?

In this article we will show Binding used for WCF REST. For more articles and videos visit us on www.questpond.com... Read More

SQL server interview question: -What are Sub-Queries, co-related queries and difference between them?

In this article we will explain about Sub-Queries and co-related queries. For more articles and videos visit us on http://www.questpond.com/... Read More

Five most important SharePoint 2010 interview questions

This article will give answers to 5 most asked questions in the interview.... Read More

WCF Interview questions and answers: -What is the difference between WCF fault exceptions and normal .NET exceptions?

In this article we will show difference between WCF fault exceptions and normal .NET exceptions. For more articles and videos visit us on http://www.questpond.com/... Read More

.NET interview questions: - Can you elaborate project life cycle?

In this article we will explain about project life cycle. For more articles and videos visit us on http://www.questpond.com/... Read More

WCF Interview questions:- Which binding do we need to use for WCF REST?

In this article we will show Binding used for WCF REST. For more articles and videos visit us on www.questpond.com... Read More

SQL server interview question: -What are Sub-Queries, co-related queries and difference between them?

In this article we will explain about Sub-Queries and co-related queries. For more articles and videos visit us on http://www.questpond.com/... Read More

Five most important SharePoint 2010 interview questions

This article will give answers to 5 most asked questions in the interview.... Read More

Article Categories