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

What is CLR? How it will work?

5 Answers  


What is CLR and how it generates native code ?

1 Answers   Digital GlobalSoft, Vital Soft,


What is namespace of asp.net mvc?

0 Answers  


And if they have conflicting method names ?

1 Answers  


Does razor engine supports for tdd?

0 Answers  


What are actions in mvc?

0 Answers  


What is html.renderpartial?

0 Answers  


What are the contents of assembly?

2 Answers  


What is the "helperpage.isajax" property?

0 Answers  


What is the necessity for singning an assembly with a strong name?

1 Answers   L&T,


What are Satellite Assemblies? How you will create this?

4 Answers  


Explain encapsulation

1 Answers   HPCL, Hughes Systique Corporation,


Categories