public static BMW createBMW() { if (bmw == null) { bmw = new BMW(); } return(bmw); }
static void Main(string[] args) { Toyota t = Toyota.createToyota(); BMW b = BMW.createBMW(); Console.WriteLine("Call the run() of the Toyota:"); t.run(); Console.WriteLine("Call the run() of the BMW:"); b.run(); }