Saturday, February 4, 2012

difference between class and structure

Class:
1)It is a referece type
2)Memory is allocated on managed Heap
3)They are not faster in access
4)New is mandatory for creating an object of a class
5)default constructor is option in under a class
6)It can be declared with variables and assigned with values while declaration
7)class provides both implementation as well as interface inheritance
The clssses for implementaion of complex business logics

Structure:
1)It is a value type
2)Memory is allocated on stack
3)They provide faster in access
4)It is optional while creating an object of a class
5)default constructor is mandatory which will be idebtified by compiler
6)It can be always declared with variables but can not be initiallised while declaration
7)it provides only interface inheritance
The strucutres for implementaion of small business logics
Post a Comment

Bel