Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

why sturcture ? why class?why you prefer structure and in
which cases u go for class?

Answer Posted / supraja

Class
-->It is reference type
-->The values allocated in heap
-->Can have constructors, properties, methods
-->Abstract and sealed are possible
-->We cannot have parameter less constructor
-->We can overload constructors
-->Reference type
-->Supports data members, code members (methods) and events
-->Supports inheritance
-->Preferable when you need to initialize one or more
members upon creation
-->Can have parameterized constructors
-->More flexible, unlimited event handling support

Structure
-->It is value type
-->The values allocated in stack
-->Can have constructors, properties, methods
-->Abstract and sealed are not possible
-->By default public
-->We cannot have parameter less constructor
-->We can overload constructors
-->Value type
-->Supports data members, code members (methods) and events
-->Can not inherit
-->Preferable when you perform large number of operations
on each instance
-->Can not control initialization using structure variable
-->Less flexible, limited event handling support

Is This Answer Correct ?    4 Yes 6 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is multicast delegate in c# ?

1044


What is c# console application?

953


Explain the difference between user control and custom control. Also, explain their use.

1059


what are the different ways a method can be overloaded?

925


What does a constructor do c#?

927


Is static thread safe?

876


What are the benefits of using the aggregate method in linq?

1009


What is data dictionary in c#?

952


What I can do with c#?

948


What is foreach loop in c#?

970


What are the string functions in c#?

974


Can we override static class in c#?

903


Why is c# a good programming language?

1000


Can properties be private in c#?

906


How many types of interface are there in c#?

986