top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

When to use Static Class in place of Singleton in Java?

+2 votes
389 views
When to use Static Class in place of Singleton in Java?
posted May 19, 2015 by Karthick.c

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

0 votes

If your application does not maintain the state of the class and used for accessing only global methods then use static class over singleton, In concurrent environment using singleton is better than static as there are more chances your code lead to race condition.

For more information
http://javarevisited.blogspot.in/2013/03/difference-between-singleton-pattern-vs-static-class-java.html

answer May 21, 2015 by Venkatesh B
...