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 is delegates and events?
What is the difference between readkey and readline in c#?
Can we have two main methods in c#?
What is indexers in C#
How can you clean up objects holding resources from within the code?
What is Co- and Contra-Variance in C#?
Is there a way to force garbage collection?
Can you override private virtual methods?
11 Answers AROBS Transilvania Software, IBM, Mind Tree, Revalsys,
What is a service layer c#?
What is the use of base keyword? Tell me a practical example for base keyword’s usage?
How long will it take to learn c#?
What do you understand by the terms datareader object and dataset object?
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)