Ejemplo n.º 1
0
 // Добавить
 public void Push(Person value)
 {
     if (length_ < arrSize)
     {
         length_++;
         data_[length_] = value;
     }
     else
         Console.WriteLine("Переполнен");
 }
Ejemplo n.º 2
0
        static void Main(string[] args)
        {
            ArrayList array = new ArrayList();

            Person person1 = new Person("Jack", 32);
            Person person2 = new Person("Kate", 27);
            Person person3 = new Person("Lock", 55);
            Person person4 = new Person("Hugo", 26);

            array.Push(person1);
            array.Push(person2);
            array.Push(person3);
            array.Push(person4);

            array.Print();

            array.Sort();
            Console.WriteLine();

            array.Print();

            Console.ReadLine();
        }