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
I need Game development tutorials Project Description: We need video tutorials like lynda for game development using unity. You must have developed games before and need to s

How can we implement singleton pattern in .NET ? The Singleton pattern basically focuses on having one and only one instance of the object running. Lets take an e.g. a windows

What is the use of the Connection object? The Connection object is used to connect your application to a specific data source by giving the needed authentication information in

How can we use .NET components in COM .NET components can't be used in straight forward way with the COM. You will require to create CCW in order to communicate COM components

If client side validation is enabled in your Web page, does that mean server side code is not run Whenever the client side validation is enabled server emit's JavaScript code f

How can we perform transactions in .NET? The common sequence of steps that would be performed for developing a transactional application is as follows: 1)In the first step o

What is the difference between proc. sent BY VAL and By Ref? By val: changes will not be reflected back to the variable. By ref: changes will be reflected back to that varia

Program of Nested Loop - C# Program I am a learner of C# language and i am struggling with the Loops in c#. Can you have any code examples for this.

What is Manual Reset Event and Auto Reset Event? The Threads that call one of the wait methods of a synchronization event should wait until other thread signals the event by ca

1. Prepare  a grocery list   having four columns (Serial number, The name of the product, quantity and price)  for the month of April, 06. Font specifications for Title(Groce