Description:
Singleton design pattern is also used in other design patterns like Abstract Factory, Builder, Prototype, Facade etc. Singleton design pattern is used in core java classes also, for example java.lang.Runtime, java.awt.Desktop.
Learn through my videos:

Program:
package singleton;
public class Singleton
 {   
public static void main(String[] args)
 {
Abc obj=Abc.getInstance();
Abc  obj1=Abc.getInstance();
    }
}
class Abc
{ 
public static Abc obj;
int i;
private  Abc()
    {
System.out.println("Instance Created");
    }
public static Abc getInstance()
    {
if(obj==null)
        {
obj=new Abc();
        }
return obj;
    }
}
Output:
Instance Created

Logic:
public static Abc getInstance()
    {
if(obj==null)
        {
obj=new Abc();
        }
return obj;
    }