Content deleted Content added
Copyedit. |
→Implementations: Changed function names from UpperCamelCase to lowerCamelCase |
||
Line 39:
}
public static Multiton
// Lazy init (not thread safe as written)
// Recommend using Double Check Locking if needing thread safety
Line 48:
}
public override string
return "My number is " + number.ToString();
}
// Sample usage
public static void
Multiton m0 = Multiton.GetInstance(MultitonType.Zero);
Multiton m1 = Multiton.GetInstance(MultitonType.One);
|