Beispiel #1
0
        static void Main(string[] args)
        {
            Pierwsza p1 = new Pierwsza {
                x = 5
            };
            Druga d1 = new Druga()
            {
                P = new Pierwsza()
                {
                    x = 6
                }, Y = 33
            };

            Console.WriteLine($"p1.x = {p1.x}");
            Console.WriteLine($"d1.y = {d1.Y}, d1.p.x = {d1.P.x}");
            Console.WriteLine();

            Pierwsza p2 = new Pierwsza(45)
            {
                x = -1
            };
            Druga d2 = new Druga(55)
            {
                P = new Pierwsza(13), Y = 44
            };

            Console.WriteLine($"p2.x = {p2.x}");
            Console.WriteLine($"d2.y = {d2.Y}, d2.p.x = {d2.P.x}");
        }
Beispiel #2
0
        static void Main(string[] args)
        {
            Pierwsza p1 = new Pierwsza()
            {
                x = 5
            };
            Druga d1 = new Druga()
            {
                p = new Pierwsza(), y = 33
            };

            Console.WriteLine("p1.x = {0}", p1.x);
            Console.WriteLine("d1.y = {0}, d1.p.x = {1}", d1.y, d1.p.x);
            Console.WriteLine();

            Pierwsza p2 = new Pierwsza(45)
            {
                x = -1
            };
            Druga d2 = new Druga(55)
            {
                p = new Pierwsza(13), y = 44
            };

            Console.WriteLine("p2.x = {0}", p2.x);
            Console.WriteLine("d2.y = {0}, d2.p.x = {1}", d2.y, d2.p.x);
        }
Beispiel #3
0
 public Druga(int y)
 {
     this.Y = y;
     this.P = new Pierwsza(2 * y);
 }
Beispiel #4
0
 public Druga()
 {
     this.Y = 11;
     this.P = new Pierwsza(101);
 }
Beispiel #5
0
 public Druga(int y)
 {
     this.y = y;
     this.p = new Pierwsza(2 * y);
 }
Beispiel #6
0
 public Druga()
 {
     this.y = 11;
     this.p = new Pierwsza(101);
 }