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

Explain dependency resolution?

0 Answers  


what is the use of final method

3 Answers   TCS,


WHICH IS MORE SECURED AMONG JAVA AND .NET?

7 Answers  


Which are the abstract classes available under system.xml namespace

1 Answers  


Why to use html.partial in mvc?

0 Answers  


Explain tempdata in mvc?

0 Answers  


What is the difference between STA and MTA?

3 Answers  


Can u tell me differences which are introduced in .Net 1.1 and 2.0 and 3.0 and also in 3.5 ? by detailed?

1 Answers   ABC,


What is objectset? : Entity framework

0 Answers  


In which assembly is the mvc framework defined?

0 Answers  


Which is the default http method for an action method?

0 Answers  


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

0 Answers  


Categories