Created
January 11, 2011 14:48
-
-
Save CodingGorilla/774498 to your computer and use it in GitHub Desktop.
Demonstrates the singleton pattern
This file contains 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 MySingleton | |
{ | |
public static readonly MySingleton Instance = new MySingleton(); | |
/* Private or protected constructor so only this class can instantiate itself */ | |
private MySingleton() | |
{ | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment