Differences between a Structure and Class

1. Class is Reference types and Structure is Value type. 

2. Class supports an Inheritance where as Structure not. 

3. Classes are usually used for large amounts of data, whereas Structure are usually used for smaller amount of data. 

4. When we instantiate a class, memory will be allocated on the heap and when Structure gets initiated it gets memory on the stack.

5. Classes can have explicit parameter less constructors. But Structure doesn't have this.

6. Classes can be garbage collector because garbage collector works on heap memory. structures can not be garbage collector so no memory management.



Comments

Unknown said…
Hi,While the web has some rules that work differently than online in Web Design Cochin, many of the same principles apply as offline as to how you try and convert them to sales. Thanks.........

Popular posts from this blog

Auto Refresh .aspx page - ASP.NET

Auto Sequence Number in Grid Control with Paging

MVC Request Execution Stages - Life Cycle

LINQ - C# Programming

ASP.NET MVC Version History

How to Edit More than 200 Rows in SQL Server 2008

Page get postback twice in Mozilla!!!!

SOLID Principles with C#

How to Update Dependent Excel Cells Automatically