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 entity graph in entity framework?
how do you truncate a table using entity data model?
Mention the core components of .net framework?
Why to use '{resource}.axd/{*pathInfo}' in routing in ASP.Net MVC?
How we can invoke child actions in ASP.Net MVC?
What is page life cycle?
Can I set the unlimited length for "maxjsonlength" property in config?
What is asp net framework?
Where is tempdata stored?
What is action methods in web api?
What is the role of the jit compiler in .net framework?
In which assembly is the mvc framework defined?
When will the .net framework 3.0 be released?
Which is the default http method for an action method?
How can you return string result from Action in ASP.Net MVC?