Пример #1
0
        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();
        }
Пример #2
0
        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);
        }