Cognizant Interview Question

What is Singleton class? where it is used?

Interview Answer

Anonymous

Sep 18, 2021

A Singleton class in Java allows only one instance to be created and provides global access to all other classes through this single object or instance. Similar to the static fields, The instance fields(if any) of a class will occur only for a single time.