Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Java Singleton

DZone's Guide to

Java Singleton

·
Free Resource
 "A single-element enum type is the best way to implement a singleton" J.Bloch


public enum Speaker {

  INSTANCE;

  public void sayLoud(String text) { ... }
}
Topics:

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}