public static void main(string[] args) { singletonclass singleto = singletonclass.getinstances(); singleto.somemethod(); singletonclass single2 = singletonclass.getinstances(); single2.somemethod(); }
public static singletonclass getinstances() { if (_instance != null) { return(_instance); } else { _instance = new singletonclass(); return(_instance); } }