Read-Only To create and edit, activate with an eligible Office 365 subscription.
ID: 3566331 • Letter: R
Question
Read-Only To create and edit, activate with an eligible Office 365 subscription. Enum Types An enum type is a type whose fields consist of a fixed set of constants. Common examples include compass directions (values of NORTH, SOUTH, EAST, and WEST) and the days of the week. Because they are gammas. the names of an enum type's fields are in uppercase letters. In the Java programming language. you define an enum type by using the enum keyword. For example, you would specify a days-of-the-week enum type as: You should use enum types any lane you need to represent a fixed set of constants That includes mural mum types such as the planets m our solar spurn and data sets where you know all possible values at compile time for example. the choices on a menu, command line flags. and so on Here is some code that shows you how to use the Day enum defined above:Explanation / Answer
Output:
Mondays are bad.
Midweek days are so-so.
Fridays are better.
Weekends are best.
Weekends are best.
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.