What is a singleton class? Give a practical example of its usage.
A singleton class is a design pattern that restricts the instantiation of a class to a single instance and provides a global point of access to that instance. In other words, it ensures that there is only one instance of the class in the entire application, and it provides a way to access that instance. The singleton pattern is commonly used when exactly one object is needed to coordinate actions across the system.