예제 #1
0
        /// <summary>
        /// Defines the entry point of the application.
        /// </summary>
        private static void Main()
        {
            Battery nokiaBattery = new Battery("B2", 168.5f, 80.5f, BatteryType.NiMH);
            Display nokiaDisplay = new Display(4.5f, 16700000L);
            CellPhone nokia = new CellPhone("C3", "Nokia", 100m, "Ivan Ivanov", nokiaBattery, nokiaDisplay);
            Console.WriteLine(nokia);

            Display galaxyDisplay = new Display(5.5f, 16700000L);
            CellPhone galaxy = new CellPhone("S3", "Galaxy", display: galaxyDisplay);
            Console.WriteLine(galaxy);

            CellPhone cheapPhone = new CellPhone("cheap", "china phones");
            Console.WriteLine(cheapPhone);

            Console.WriteLine(CellPhone.IPhone4S);
        }
예제 #2
0
 /// <summary>
 /// Initializes static members of the <see cref="CellPhone"/> class.
 /// </summary>
 static CellPhone()
 {
     Battery battery = new Battery("B2", 168.5f, 80.5f, BatteryType.LiIon);
     Display display = new Display(4.5f, 16700000L);
     iphone4S = new CellPhone("4S", "Apple", 700.50m, "Bai Ivan III", battery, display);
 }