Difference between class and structure, DOT NET Programming

What is the difference between Class and structure's?

The main differences between them are as follows:-

1) The Structure is value types while classes are reference types. Hence structures use stack and classes use heap.

2) The Structures members can not be declared as protected, while the class members can be. You can not do inheritance in the structures.

3) The Structures do not require constructors but classes require.

4) The Objects created from classes are terminated using Garbage collector. While Structures are not destroyed using GC.

Posted Date: 9/22/2012 3:12:39 AM | Location : United States







Related Discussions:- Difference between class and structure, Assignment Help, Ask Question on Difference between class and structure, Get Answer, Expert's Help, Difference between class and structure Discussions

Write discussion on Difference between class and structure
Your posts are moderated
Related Questions
Design the following interface and add code to the command buttons to achieve the following using case statement. I) find coursework to be calculated using the following formula:-0

cookieless="false" timeout="20" /> Above is sample session state mode specified for SQL SERVER.

Locate BUG website Project Description: Can you find a bug in easports fifa 14 ultimate team web app (easports/fifa/football-club/ultimate-team) so that i will earn a lot of

Name the control that exposes the LINQ features to Web developers through the ASP.NET data-source control architecture. The LinqDataSource control exposes the LINQ features to

A few changes to OutloProject Description: We require someone who is familiar with programming plug-in to work with Microsoft Outlook. Initially we just require a simple chan

Project Description: We require working system to send message in bulk to whats-app numbers without getting blocked. Multiple senders can be used. Skills required: .NET, P

Project Description: We have a web based program prepared with .NET C# and Microsoft SQL Server. There are some reports needs to be created. Required Skills. - High Pro


What is Array List? An Array is whose size can increase or decrease dynamically. The Array list can hold item of various types. As Array list can increase and decrease his size

What is the difference between "using System.Data;" and directly adding the reference from "Add References Dialog Box"? When you compiles a program using command line, u add th