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 the difference between interface and multiple interface?
What are PE(Portable Executable)?
Is IIS is required for installing the deployment of windows C#.netapplication and to run.
Explain the differences between static, void and public in c#?
What is array class in c#?
Is the following code legal?
What is bitwise operator in c#?
List some of the classes used by system.data namespace?
What is literal control
What is append in c#?
Why do we use yield in c#?
How to implement an object pool in c#.net.