Exemple #1
0
        public override bool Equals(object obj)
        {
            if (obj == null)
            {
                return(false);
            }
            Listt <T> a = obj as Listt <T>;

            if (a as Listt <T> == null)
            {
                return(false);
            }
            return(a.data == data);
        }
Exemple #2
0
        static void Main(string[] args)
        {
            try
            {
                Listt <int> Q = new Listt <int>();
                Listt <int> W = new Listt <int>();
                for (int i = 0; i < 5; i++)
                {
                    MyType temp = new MyType();
                    temp.x = i;
                    Q.data.Add(temp.x);
                    W.Push(temp.x);
                }

                Q--;                       //--
                Q = Q + 20;                //+

                Console.WriteLine(Q != W); // operator !=


                for (int i = 0; i < 5; i++)
                {
                    Console.Write($"{Q.GetElement(i)} ");
                }

                Listt <int> .Owner A = new Listt <int> .Owner(18, "\nFilipp");

                A.Out();
                Listt <int> .Date B = new Listt <int> .Date(8, 2);

                B.Out();
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
            finally
            {
                Console.WriteLine("Hello world");
            }
        }