public void HearMessage(string message, Elephant whoSaidIt) { Console.WriteLine(Name + " heard a message"); Console.WriteLine(whoSaidIt.Name + " said this: " + message); }
public void SpeakTo(Elephant whoToTalkTo, string message) { whoToTalkTo.HearMessage(message, this); }
public void HearMessage(string message, Elephant whoSaidIt) { Console.WriteLine($"{Name} heard a message"); Console.WriteLine($"{whoSaidIt.Name} saind this: {message}"); }