How are enums useful? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson

How are enums useful?

25th Jul 2017, 11:04 PM
Chris - avatar
2 Answers
+ 8
They can save you from errors, for example. When you need some variable to be one of a (certain) set of values.
26th Jul 2017, 12:13 AM
Andrew Harchenko (Tomsk)
Andrew Harchenko (Tomsk) - avatar
Andrew Harchenko, what do you mean by one of a (certain) set of values? What values variables can be?
17th Sep 2019, 1:22 PM
Anna Shepilova
Anna Shepilova - avatar