Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Javaの列挙型クラスのシングルトンインスタンスとは?
おそらく、列挙型を使用してシングルトン パターンを実装することについて話しているのでしょうか。
public enum Singleton { INSTANCE; public void singletonMethod() { ... } }
enum が Java に追加されたため、これがシングルトンを実装する最良の (最短で最も正しい) 方法です。