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