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 RouteConfig.cs in ASP.Net MVC 4?
What are the major improvements provided by the common language runtime and the base class libraries? Or what are the major improvements in .net framework 4.0?
what is deferred loading(lazy loading)?
Explain the advantages of asp.net mvc over asp.net?
Explain the new features added in version 4 of mvc (mvc4)?
Is .net core replacing .net framework?
What is Area in ASP.Net MVC?
What is code first? : Entity framework
Why to use “{resource}.axd/{*pathinfo}” in routing in mvc?
what is csdl?
What is the domain object?
What is associationset? : Entity framework
What happens when I install the .net framework 3.0? How can I upgrade if I already have the .net framework 2.0 installed?
What are ajax helpers in asp.net mvc?
How to Redirect Tracing to a File