Skip to content

Instantly share code, notes, and snippets.

@Climber24
Created January 27, 2017 15:50
Show Gist options
  • Select an option

  • Save Climber24/c22322f6f7be5be73580097a99a5ffda to your computer and use it in GitHub Desktop.

Select an option

Save Climber24/c22322f6f7be5be73580097a99a5ffda to your computer and use it in GitHub Desktop.

Revisions

  1. Climber24 revised this gist Jan 27, 2017. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion JAVA Singleton example.java
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,6 @@
    public class Singleton
    {
    static Singleton singletone = new Singleton();
    private static Singleton singletone = new Singleton();
    private static int counter = 0;
    private Singleton() {}
    static Singleton getInstance() {
  2. Climber24 created this gist Jan 27, 2017.
    9 changes: 9 additions & 0 deletions JAVA Singleton example.java
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,9 @@
    public class Singleton
    {
    static Singleton singletone = new Singleton();
    private static int counter = 0;
    private Singleton() {}
    static Singleton getInstance() {
    return singletone;
    }
    }