Пример #1
0
 public void PrintYear(President p) => Console.WriteLine(p.Year.ToString());
Пример #2
0
 public void PrintParty(President p) => Console.WriteLine(p.Party);
Пример #3
0
 public void PrintState(President p) => Console.WriteLine(p.State);
Пример #4
0
 public void PrintLastName(President p) => Console.WriteLine(p.LastName);
Пример #5
0
 public void PrintString(President p) =>
 Console.WriteLine($"{FirstName} {LastName} from {State} was a {Party} elected in {Year}.");
Пример #6
0
 //print takes a President argument and returns void
 public void PrintFirstName(President p) => Console.WriteLine(p.FirstName); // Expression, body, method