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


Please Help Members By Posting Answers For Below Questions

What are scaffold templates in mvc?

580


What is .net framework in simple terms?

538


How can I return string result from action in asp.net mvc?

564


Is dapper better than entity framework?

531


How to bind table colum with gridview column?

609






How does work clr?

531


What is orm entity framework?

518


What is the use of display modes?

578


What is the difference between windows vista and .net framework 3.0 ?

539


What are the benefits of .net framework?

561


What is domain class model?

514


What are authentication filters in web api?

573


What is RouteConfig.cs in ASP.Net MVC 4?

575


What is an asynchronous controller in asp.net mvc?

539


what is more complex to implement property, methods or event? how can I define criteria to compare the difficulty of implementation between them? for example the number of methods wanted to implements property is 2 methods. how many methods I need it to implements events?

1690