DEV Community

Jocelyne1124
Jocelyne1124

Posted on

Enums lesson 19

In this lesson we learned about enums which are sort of like a list of things, There are also cases in the enums, these can be compared to list items. Creating enums makes it better when we are coding and want to provide the user with different options but not any option. The user will only be able to chose from the options provided by the program. Using an enum is better than using a string or an int for this same reason. For example, imagine you ask a toddler what their favorite color is they might say something like apple... We know that is not an option, now with an enum we can ask them the same question but when they answer us they must answer from only colors! so they would say something like green or blue or blue-green.

Top comments (0)