Thibstars icon

IntelliJ Singleton Template

Thibstars | PRO | 01/09/16 01:43:29 PM UTC | 0 ⭐ | 203 👁️ | Never ⏰ | []
Java |

480 B

|

None

|

0 👍

/

0 👎

#if (${PACKAGE_NAME} && ${PACKAGE_NAME} != "")package ${PACKAGE_NAME};#end
#parse("File Header.java")
public final class ${NAME}{
    private static ${NAME} classInstance = new ${NAME}();
 
    private ${NAME}() {
        //Constructor not publicly available
    }
 
    public static synchronized ${NAME} getInstance() {
        return classInstance;
    }  
    
    @Override
    protected Object clone() throws CloneNotSupportedException {
        return super.clone();
    }
}

Comments