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 c# most used for?
What is c-sharp (c#)?
when data member or member function is static is acess specifier is considered??
Can a method return multiple values in c#?
Explain the difference between the system.array.copyto() and system.array.clone()?
What is parse method in c#?
how to deplaoy a project in the system?
What are handlers in c#?
What are extensions in c#?
Illustrate namespaces in c#?
Can we make a class private in c#?
What is sqlcommandbuilder c#?