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
What is DISCO? The Web Service Description Language (WSDL) is a W3C specification which defines the XML grammar for describing the Web Services.XML grammar describes details li

How to clear a datagrid on a button click? You require to Clear the DataSource of the dadaGrid. So try this: dataSet1.Clear(); dataGrid1.DataSource = dataSet1.TableNam

Screen sharing Training software like GOTOMEETING Project Description: We do have online trainings business; we are providing trainings with webex or gotomeeting at this mome

What is the DTD? The DTD is Document Type Definition that explains the formation of the content of an XML document. The DTD manages the data to keep in a consistent format. It

What is Cache Callback? The Cache object is dependent on its dependencies for example time based, file based, etc...The Cache items remove the object when cache dependencies ch

Mention different types of data providers available in .NET Framework. .NET Framework Data Provider for SQL Server - Give access to Microsoft SQL Server 7.0 or later version. I

How do we configure "WebGarden"? The process model configured the "Web garden" settings in the "machine.config" or in the "Web.config" file. The configuration section is named

Have you ever worked with Microsoft Application Blocks, if yes then which? The Application Blocks are C# & the VB.NET classes distributed as the Visual Studio projects which ca

What is ASP.NET AJAX? ASP.NET AJAX, mostly called AJAX, is a set of extensions of ASP.NET. It is developed by Microsoft to execute AJAX functionalities in Web applications. ASP

What is Query String and what are their benefits and limitations? The query string is the information sent to the server appended to the end of a page URL. The benefits of u