Difficulty
 

Singleton Pattern

Singleton pattern is focused on creating only one instance of an object in memory, sharable by all classes and threads within the application.

Singleton = global object created by singleton pattern

Blocks:
– private default no-argument constructor (this ensures that no other class is capable of instantiating another version of this class -> effectively final class)
– private static instance of this object (named instance)
– public static method getInstance(), returning the reference to this singleton object

ensuring that only one instance of the object exists throughout the Java Virtual Machine.

Last update 22.09.2019.
For possible mistakes in content or typos, I apologise and kindly ask you to report here.