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