示例#1
0
        public static void Main()
        {
            //Person aPerson = new Person("Xiao Wang", 27);
            //aPerson.ChangeName("Apple Boy");

            //IBusRole passager = new Person();
            //passager.BuyTicket();

            //ISchoolRole student = new Person();
            //student.PlayBall();
            IPerson aPerson = new PersonAtHome();

            aPerson.DoWork();
            IPerson bPerson = new PersonOnBus();

            bPerson.DoWork();
        }
示例#2
0
        public static void Main()
        {
            //Person aPerson = new Person("Xiao Wang", 27);
            //aPerson.ChangeName("Apple Boy");

            //IBusRole passager = new Person();
            //passager.BuyTicket();

            //ISchoolRole student = new Person();
            //student.PlayBall();
            IPerson aPerson = new PersonAtHome();
            aPerson.DoWork();
            IPerson bPerson = new PersonOnBus();
            bPerson.DoWork();
        }