コード例 #1
0
ファイル: Toyota.cs プロジェクト: nthuhuong/CodingTest
 public static Toyota createToyota()
 {
     if (toyota == null)
     {
         toyota = new Toyota();
     }
     return(toyota);
 }
コード例 #2
0
        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();
        }