この記事の要約:Javaの列挙型(Enum)が、どのようにして固定された値のセットを提供し、整数定数に代わる型安全なソリューションとなるかを詳説します。また、プログラムを構成する基礎的な要素である字句要素(トークン、識別子)や ...
An enumerated type specifies a set of related constants as its values. Examples include the days in a week, the standard north/south/east/west compass directions, a currency’s coin denominations, and ...
対話型AI(人工知能)にアドバイスを受けながら進めるJavaプログラミングの入門連載。今回も、オブジェクト指向プログラミングの機能として、列挙型を学習します。特別なクラスとしての列挙型を、その意義とともに理解しましょう。 今回のテーマは列挙 ...
Although it is part of the java.util.concurrent package, the TimeUnit enum is useful in many contexts outside of concurrency. In this post, I look at how the TimeUnit enum can be used even in code ...