What is the difference between structures and enumeration ?



What is the difference between structures and enumeration ?..

Answer / 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

More Dot Net Framework Interview Questions

How can Bitwise OR operator reresents in .Net?? To which alias name a variable points to if it is declared as "int" variable??

1 Answers  


What are the 3 segments of the default route, that is present in an ASP.NET MVC application?

0 Answers   NA,


What is the difference between tempdata and viewbag?

0 Answers  


How do you box a primitive data type variable ?

1 Answers  


What is meant by tempdata in mvc?

0 Answers  






What are the differences between Partial View and Display Template and Edit Templates in ASP.Net MVC?

0 Answers  


Explain Sections is ASP.Net MVC?

0 Answers  


What is the use of view model in asp.net mvc?

0 Answers  


Why we need a separate mobile project template, while we can render our web application in mobile ?

0 Answers  


What is the advantage of mvc?

0 Answers  


Mention the core components of .net framework?

0 Answers  


How we can add the css in mvc?

0 Answers  


Categories