static void Main(string[] args) { Success v1 = new Success(); Man man = new Man(); man.Accept(v1); Woman woman = new Woman(); woman.Accept(v1); Console.Read(); }
/// <summary> /// 得到女人的结论 /// </summary> /// <param name="woman"></param> public abstract void GetWomanConclusion(Woman woman);
public override void GetWomanConclusion(Woman woman) { Console.WriteLine($"{woman.GetType().Name} {GetType().Name} 时,欣慰曰:爱情长路跑漫漫,婚姻保险保平安."); }
public override void GetWomanConclusion(Woman woman) { Console.WriteLine($"{woman.GetType().Name} {GetType().Name} 时,背后多有一个不成功的男人"); }
public abstract void GetWomanConclusion(Woman concreElementB);
public override void GetWomanMessage(Woman woman) { Console.WriteLine($"{woman.GetType().Name}-{this.GetType().Name}"); }
public override void GetWomanConclusion(Woman woman) { Console.WriteLine("女人失败时,泪眼汪汪,谁也劝不了"); }
public override void GetWomanConclusion(Woman woman) { Console.WriteLine("女人恋爱时,凡事懂也装不懂"); }
public override void GetWomanConclusion(Woman concreteElementB) { Console.WriteLine("{0} {1}时,背后大多是个不成功的男人。", concreteElementB.GetType().Name, this.GetType().Name); }
public override void GetWomanConclusion(Woman woman) { Console.WriteLine("女人成功时,背后总有一个不争气的难人"); }
public override void GetWomanConclusion(Woman concreteElementB) { Console.WriteLine("{0}{1}时,眼泪汪汪,谁也劝不了", concreteElementB.GetType().Name, this.GetType().Name); }
public override void GetWomanConclusion(Woman concreElementB) => Console.WriteLine($"{concreElementB.GetType().Name}{this.GetType().Name}时,懂也装作不懂");
public abstract void GetWomanMessage(Woman woman);
public override void GetWomanConclusion(Woman woman) { throw new NotImplementedException(); }
public override void GetWomanConclusion(Woman woman) { Console.WriteLine("{0} {1}", woman.GetType().Name, GetType().Name); }