public static void main(string[] args) { Person Kenny = new Person("Kenny", 28); Person Gerry = new Person("Gerry", 34); Console.WriteLine(Kenny.CompareTo(Gerry)); Console.ReadLine(); }
private void personButton_Click(object sender, EventArgs e) { Person p = new Person(); p.FirstName = "gerard"; p.LastName = "said"; p.Age = 34; Person p2 = new Person(); p2.FirstName = "joe"; p2.LastName = "borg"; p2.Age = 35; outputText.Text = p.printMe(); p.shootMe(); outputText.Text += "\n"+p.printMe(); outputText.Text += p.CompareTo(p2); }
private void personButton_Click(object sender, EventArgs e) { Person p = new Person(); p.FirstName = "gerard"; p.LastName = "said"; p.Age = 34; Person p2 = new Person(); p2.FirstName = "joe"; p2.LastName = "borg"; p2.Age = 35; outputText.Text = p.printMe(); p.shootMe(); outputText.Text += "\n" + p.printMe(); outputText.Text += p.CompareTo(p2); }