예제 #1
0
파일: Program.cs 프로젝트: niuniuliu/CSharp
        static void Main(string[] args)
        {
            IList<Person> persons = new List<Person>();

            Person man1 = new Man();
            man1.Action = "成功";
            persons.Add(man1);
            Person woman1 = new Woman();
            woman1.Action = "成功";
            persons.Add(woman1);

            Person man2 = new Man();
            man2.Action = "失败";
            persons.Add(man2);
            Person woman2 = new Woman();
            woman2.Action = "失败";
            persons.Add(woman2);

            Person man3 = new Man();
            man3.Action = "恋爱";
            persons.Add(man3);
            Person woman3 = new Woman();
            woman3.Action = "恋爱";
            persons.Add(woman3);

            foreach (Person item in persons)
            {
                item.GetConclusion();
            }

            Console.Read();
        }
예제 #2
0
        static void Main(string[] args)
        {
            IList <Person> persons = new List <Person>();

            Person man1 = new Man();

            man1.Action = "成功";
            persons.Add(man1);
            Person woman1 = new Woman();

            woman1.Action = "成功";
            persons.Add(woman1);
            foreach (Person item in persons)
            {
                item.GetConclusion();
            }
        }
예제 #3
0
        static void Main(string[] args)
        {
            IList <Person> persons = new List <Person>();

            Person man1 = new Man();

            man1.Action = "成功";
            persons.Add(man1);
            Person woman1 = new Woman();

            woman1.Action = "成功";
            persons.Add(woman1);

            Person man2 = new Man();

            man2.Action = "失败";
            persons.Add(man2);
            Person woman2 = new Woman();

            woman2.Action = "失败";
            persons.Add(woman2);

            Person man3 = new Man();

            man3.Action = "恋爱";
            persons.Add(man3);
            Person woman3 = new Woman();

            woman3.Action = "恋爱";
            persons.Add(woman3);

            foreach (Person item in persons)
            {
                item.GetConclusion();
            }

            Console.Read();
        }
 public override void GetWonmanConclusion(Woman woman)
 {
     Console.WriteLine($"{woman.GetType().Name}{this.GetType().Name}时,凡事懂也装不懂");
 }
 public override void GetWonmanConclusion(Woman woman)
 {
     Console.WriteLine($"{woman.GetType().Name}{this.GetType().Name}时,背后大多有一个不成功的男人");
 }
 public abstract void GetWonmanConclusion(Woman woman);
예제 #7
0
 public override void GetWomanConclusion(Woman concreteElementB)
 {
     Console.WriteLine("{0}{1}时,欣慰曰:爱情长跑路漫漫,婚姻保险保平安。", concreteElementB.GetType().Name, this.GetType().Name);
 }
예제 #8
0
 public override void GetWomanConclusion(Woman concreteElementB)
 {
     Console.WriteLine("{0}{1}时,遇事懂也装作不懂", concreteElementB.GetType().Name, this.GetType().Name);
 }
예제 #9
0
 //得到女人结论或反应
 public abstract void GetWomanConclusion(Woman concreteElementB);
예제 #10
0
 public override void GetWomanConclusion(Woman concreteElementB)
 {
     Console.WriteLine("{0}{1}时,欣慰曰:爱情长跑路漫漫,婚姻保险保平安。", concreteElementB.GetType().Name, this.GetType().Name);
 }
예제 #11
0
 public override void GetWomanConclusion(Woman concreteElementB)
 {
     Console.WriteLine("{0}{1}时,眼泪汪汪,谁也劝不了。", concreteElementB.GetType().Name, this.GetType().Name);
 }
예제 #12
0
 public override void GetWomanConclusion(Woman concreteElementB)
 {
     Console.WriteLine("{0}{1}时,背后大多有一个不成功的男人。", concreteElementB.GetType().Name, this.GetType().Name);
 }
예제 #13
0
 //得到女人结论或反应
 public abstract void GetWomanConclusion(Woman concreteElementB);