What is ENUM?

Answer Posted / nishesh

ENUM is a user defined data type. and it is declared to hold constant values for a set of data
example

enum days {sun,mon,tue,wed,thur,fri,sat}

will assign values like this
sun=0
mon=1
tue=2
and so on
if we want to use that series then we can do like this

int First_day=(int)days.sun;

it will give

First_day = 0

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

List the fundamental oop concepts?

523


How to open a new form on button click in Windows forms?

526


What is the use of regex in c#?

496


Is c# 8 released?

494


What are the properties of c#?

487






What is use of singleton class in c#?

497


How objects are stored in memory?

499


What is the difference between yield and return?

466


What are the variables in c#?

502


What are fields in c#?

498


Is array immutable in c#?

482


What is difference between array and collection?

470


What is the advantage of extension method in c#?

463


Is null empty or whitespace c#?

501


What are access modifiers used for?

593