How to use Enum as Singleton in Java with Example
Advertisements
| Top Tutorials | New Tutorials | Submit | Login | Register |
Tutorial Detail
How to use Enum as Singleton in Java with Example
From Java 5 onwards there is a new way to implement Singleton design pattern, by using Enum. Enum has some distinct benefits in terms of thread-safetyhttp://javarevisited.blogspot.com/2012/07/why-enum-singleton-are-better-in-java.html
Total Hits: 6059
Total Votes: 21 votes
Category: JAVA/Getting Started
Submitted on: 2012-11-01 15:37:10
Submitted By: Javin Paul
Description:
From Java 5 onwards there is a new way to implement Singleton design pattern, by using Enum. Enum has some distinct benefits in terms of thread-safety during instance creation, serialization guarantee by JVM and amazingly reduce amount of code which makes it perfect choice of using as Singleton class. More detail...Rating Detail
| Stars | Percentage | Total Vote |
|---|---|---|
![]() |
![]() ![]() 23.81% |
5 |
![]() ![]() |
![]() ![]() 14.29% |
3 |
![]() ![]() ![]() |
![]() ![]() 28.57% |
6 |
![]() ![]() ![]() ![]() |
![]() ![]() 14.29% |
3 |
![]() ![]() ![]() ![]() ![]() |
![]() ![]() 9.52% |
2 |





23.81%

14.29%

28.57%

14.29%

9.52%