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 is entityset? : Entity framework

564


What is difference between html.beginform and ajax.beginform?

599


Give an example for authorization filters in an asp.net mvc application?

527


Can you explain the page life cycle of mvc?

551


What is managed extensibility framework?

553






Which filter executes first in an asp.net mvc application?

546


What is Separation of Concerns in ASP.NET ASP.Net MVC?

593


Can we change web.config settings from iis?

544


What is associationset? : Entity framework

553


What is the difference between .net core and .net framework?

491


Can we add constraints to the route? If yes, explain how we can do it?

725


what is client wins and store wins mode in entity framework concurrency?

638


What is representational state transfer (rest) mean?

547


What is Differnce between html.action and ajax.action?

553


what is dot net? what is use dot net? what is benifit of dot net?what is vb dot net? what is ado dot net? what is c#?

1797