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 do you mean by “finalize” and “finally” methods in c#?

853


Expalin the way you implement inheritance by using VB.NET/C#?

911


Explain the difference between “system.array.clone()” and “system.array.copyto()” in c#?

882


Why do we need delegates in c#?

910


What is xml document how do you open it?

918


Define clr in .net?

927


What is boolean conditions in c#?

915


What are the Types of assemblies that can be created in dotnet

1095


What is inheritance c#?

853


Perfect Example Of While And Do-While Loop In C#.Net ?

927


What is strongly typed view?

832


What is asp net c# corner?

1251


Explain the types of comments in c#?

860


What is iformatprovider in c#?

865


What is a console operator?

842