top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

What is lazy and early loading of Singleton and how will you implement it?

+3 votes
117 views
What is lazy and early loading of Singleton and how will you implement it?
posted May 12, 2015 by Karthick.c

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

1 Answer

0 votes

As there are many ways to implement Singleton like using double checked locking or Singleton class with static final instance initialized during class loading. Former is called lazy loading because Singleton instance is created only when client calls getInstance() method while later is called early loading because Singleton instance is created when class is loaded into memory.

answer May 13, 2015 by Shyam
...