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
Do you know about the new features in asp.net mvc 4 (asp.net mvc4)?
What is work of clr?
What is ado.net data provider? : Entity framework
Is it possible to unit test an mvc application without running the controllers in an asp.net process?
What is oauth in web api?
What is MVVM design pattern?
mention what is csdl, ssdl and msl sections in an edmx file?
What is the .net framework and how does it work?
How does the .net framework 3.0 relate to the .net framework 2.0?
Possible ways to prevent xss attacks on mvc application?
Explain the advantages and disadvantages of ASP.Net MVC over ASP.NET?
What are Model Binders in ASP.Net MVC?
Is .net framework going away?
How route table has been created in ASP.NET ASP.Net MVC?
what do you mean by table-per-hierarchy?