Esempio n. 1
0
        static void Main(string[] args)
        {
            Console.WriteLine("enter mobile name");
            Console.WriteLine("Enter Father Name");
            string        result = Console.ReadLine();
            IMobileDetail type   = MobileInformation.MobileType(result);

            Console.WriteLine(type.Name());
            Console.WriteLine(type.OperatingSystem());
        }
Esempio n. 2
0
        public static IMobileDetail MobileType(string name)
        {
            IMobileDetail value = null;

            if (name == "Nokia")
            {
                value = new Nokia();
            }
            else
            {
                value = new Apple();
            }
            return(value);
        }