how to make enum? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

how to make enum?

18th Nov 2018, 10:14 AM
2 Answers
+ 5
Depends on the language. You usually type the key word enum followed by its name, e.g. Weekdays and then you specify in curly braces the values it can take, for example enum Weekdays { MONDAY, TUESDAY, etc. } The values are usually written in uppercase to signal that they are constants. Here is an example in Java:
18th Nov 2018, 10:31 AM
Shadow - avatar
+ 2
First, use google. If there is something you couldn't understand with the answer you found, or if you couldn't find an answer, then come here and ask. So with this way, on the other hand, you do improve your searching skills.
18th Nov 2018, 10:30 AM
Mustafa K.
Mustafa K. - avatar