Exemple #1
0
        public int Compare(object x, object y)
        {
            Persoana p1 = x as Persoana;
            Persoana p2 = y as Persoana;

            return(string.Compare(p1.nume, p2.nume));
        }
Exemple #2
0
        static void Main(string[] args)
        {
            Persoana  p        = new Persoana("George", 20);
            ArrayList persoane = new ArrayList();

            persoane.Add(new Persoana("David", 21));
            persoane.Add(new Persoana("Andrei", 20));
            persoane.Sort(p);
            Console.WriteLine(persoane[0] + "   " + persoane[1]);
            Console.ReadKey();
        }