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 |
What does using system mean in c#?
Why we use get and set method in c#?
When should I use static in C#?
0 Answers SwanSoft Technologies,
what is garbage collection?
Why can’t struct be used instead of class for storing entity?
To compute the monthly, half-yearly and annual sales made by all the salesmen of a company.
what is c# command?
Can we call server-side code (c# or vb.net code) from javascript?
What is threading in c# with example?
What are the differences between static, public and void in c#?
Why dictionary is used in c#?
When do you absolutely have to declare a class as abstract (as opposed to free-willed educated choice or decision based on UML diagram)?
Visual Basic (800)
C Sharp (3816)
ASP.NET (3180)
VB.NET (461)
COM+ (79)
ADO.NET (717)
IIS (369)
MTS (11)
Crystal Reports (81)
BizTalk (89)
Dot Net (2435)
Exchange Server (362)
SharePoint (720)
WCF (340)
MS Office Microsoft (6963)
LINQ Language-Integrated Query (317)
WPF (371)
TypeScript (144)
Microsoft Related AllOther (311)