Skip to content

Instantly share code, notes, and snippets.

@jaspercastillo
Created November 3, 2014 11:25
Show Gist options
  • Save jaspercastillo/4bc235dea961935cc5f0 to your computer and use it in GitHub Desktop.
Save jaspercastillo/4bc235dea961935cc5f0 to your computer and use it in GitHub Desktop.
package com.quillbytes.scratch.singletons;
public class SingletonSync {
private static SingletonSync INSTANCE;
private SingletonSync() { }
public static synchronized SingletonSync getInstance() {
if (INSTANCE == null) {
INSTANCE = new SingletonSync();
}
return INSTANCE;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment