Stranger Things in Java: Enum Types
This article is part of the series “ Stranger things in Java ,” dedicated to language deep dives that will help us master even the strangest scenarios that can arise when we program. All articles are inspired by content from the book “ Java for Aliens ” (in English), the book “ Il nuovo Java ”, and the book “ Programmazione Java .” This article is a short tutorial on enumeration types , also called enumerations or enums . They are one of the fundamental constructs of the Java language, alongside classes, interfaces, annotations, and records. They are particularly useful to represent sets of known and unchangeable values, such as the days of the week or the cardinal directions.
Continue reading on DZone
Opens in a new tab


