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?



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

Answer / 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

More C Sharp Interview Questions

What does using system mean in c#?

0 Answers  


Why we use get and set method in c#?

0 Answers  


When should I use static in C#?

0 Answers   SwanSoft Technologies,


what is garbage collection?

8 Answers   Protech,


Why can’t struct be used instead of class for storing entity?

0 Answers  


To compute the monthly, half-yearly and annual sales made by all the salesmen of a company.

1 Answers   Philips,


what is c# command?

0 Answers  


Can we call server-side code (c# or vb.net code) from javascript?

0 Answers  


What is threading in c# with example?

0 Answers  


What are the differences between static, public and void in c#?

0 Answers  


Why dictionary is used in c#?

0 Answers  


When do you absolutely have to declare a class as abstract (as opposed to free-willed educated choice or decision based on UML diagram)?

1 Answers  


Categories