Minggu, 30 Mei 2010
Static constructor in C#
Did you ever implement a singleton in c#? For those who don't know what a singleton is, it is a class which can only have one instance, more on Wikipedia. The preferred implementation of a singleton in c# is the following. public sealed class Singleton{ //single instance private static readonly Singleton instance = new Singleton(); //private constructor private Singleton(){} public
Langganan:
Posting Komentar (Atom)
Tidak ada komentar:
Posting Komentar