What is the difference between structures and enumeration ?
Answer Posted / kirti
Unlike classes, structs are value types and do not require heap allocation. A variable of a struct type directly contains the data of the struct, whereas a variable of a class type contains a reference to the data. They are derived from System.ValueType class.
Enum->An enum type is a distinct type that declares a set of named constants.They are strongly typed constants. They are unique types that allow to declare symbolic names to integral values. Enums are value types, which means they contain their own value, can't inherit or be inherited from and assignment copies the value of one enum to another.
public enum Grade
{
A,
B,
C
}
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
What is session state management?
Which version of the common language runtime (clr) does the .net framework 3.0 use?
What is the use of display modes?
How to Redirect Tracing to a File
What are the advantages of mvc over asp.net?
Is the following route definition a valid route definition? {controller}{action}/{id}
How does the 'page lifecycle' of asp.net mvc works?
How we can call a JavaScript function on the change of a Dropdown List in ASP.Net MVC?
Which filter executes first in an asp.net mvc application?
Explain Bundle.Config in ASP.Net MVC4?
Will there be a .net compact framework 3.0 release with release of .net framework 3.0?
How to update one of my table in database at 4pm every day how it is possible?
Explain test driven development (tdd) ?
Explain unit test done by tester on development team?
What is NonActionAttribute ?