Singleton is Design Pattern in which you make the constructor private so that its object cannot be declare directly, you will need to create Instance of the class and than you can use it.
public class Singleton {
private static final Singleton instance;
private Singleton(){}
public static Singleton getInstance() {
if (instance == null)
instance = new Singleton();
return instance;
}
}
public Singleton singleton = Singleton.getInstance();
Sealed Class:
Just go through this points and you will get idea of sealed class
1. A class, which restricts inheritance for security reason is declared, sealed class.
2. Sealed class is the last class in the hierarchy.
3. Sealed class can be a derived class but can't be a base class.
4. A sealed class cannot also be an abstract class. Because abstract class has to provide functionality and here we are restricting it to inherit.
Static Class:
Static class is used where you have some utilities lib in you project and you can create common class and can set as Static class
Static classes only contain static members.
Static classes can not be instantiated. They cannot contain Instance Constructors