Created
November 29, 2016 09:39
-
-
Save kevalpatel2106/5eae0f2ba32530a1ea816868e52c473e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class SingletonTester { | |
public static void main(String[] args) { | |
//Instance 1 | |
SingletonClass instance1 = SingletonClass.getInstance(); | |
//Instance 2 | |
SingletonClass instance2 = SingletonClass.getInstance(); | |
//now lets check the hash key. | |
System.out.println("Instance 1 hash:" + instance1.hashCode()); | |
System.out.println("Instance 2 hash:" + instance2.hashCode()); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment