示例#1
0
        static void Main(string[] args)
        {
            Emplyee em = new Emplyee {
                Name = ""
            };
            Tool    tool  = new Bike();
            Emplyee em2   = new Emplyee();
            Tool    tool2 = new Car();

            em.GoHome(tool);
            em2.GoHome(tool2);
            Console.Read();
        }
示例#2
0
        static void Main(string[] args)
        {
            Emplyee Emp    = new Emplyee();
            int     salary = 0;
            string  name;

            Console.Write("輸入員工姓名:");
            name = Console.ReadLine();
            Console.Write("輸入員工薪水:");
            salary = int.Parse(Console.ReadLine());
            Emp.Ename_list(name, salary);
            Emp.printData();
            Console.Read();
        }