示例#1
0
文件: Class1.cs 项目: TheGer/Examples
        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
文件: Form1.cs 项目: TheGer/Examples
        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);
        }