static void Main(string[] args) { Singleobjects uno = Singleobjects.getInstance(); uno.seta("La ciudad es"); uno.showMessage(); Singleobjects dos = Singleobjects.getInstance(); dos.seta("La temperatura es: "); uno.showMessage(); Console.ReadKey(); }
public static Singleobjects getInstance() { if (instance == null) { instance = new Singleobjects(); return(instance); } else { return(instance); } }