0

Can we put numerical value in enum?

like enum Prime{ 2, 3, 5, 7} Prime a= Prime.2 Switch(a){ Case(2) .......

29th Jan 2017, 1:51 PM
Jahangeer Asif
Jahangeer Asif - avatar
3 Réponses
0
Yup
29th Jan 2017, 2:00 PM
fatma fathy
fatma fathy - avatar
0
@fatma i tried but i am getting error in execution.
29th Jan 2017, 2:03 PM
Jahangeer Asif
Jahangeer Asif - avatar
0
They should follow the normal naming rules, so they can't start with (or only contain) numbers.
29th Jan 2017, 2:41 PM
Robobrine
Robobrine - avatar