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 the difference between entity framework and mvc?
What are ajax helpers in asp.net mvc?
Explain the new features added in version 4 of mvc (mvc4)?
What is clr? How does work clr & wht is work of clr?
How can I return string result from action in asp.net mvc?
What is the difference between viewbag and viewdata in mvc?
Difference between ASP.NET MVC and ASP.NET WebForms?
How does the .net framework 3.0 relate to windows vista?
What are the components of the .net framework.
Why is the .net framework 3.0 a major version number of the .net framework if it uses the .net framework 2.0 runtime and compiler?
What is .net architecture?
what is msl?
how do you mark a property as required? For example, for a project, the name is a required field.
What is orm entity framework?
What are advantages of Dependency Injection (DI) in ASP.Net MVC?