Example #1
0
        static void Main(string[] args)
        {
            GFG g = new GFG("Hello", "World");

            //Here g details is copied to g1
            GFG g1 = new GFG(g);

            Console.WriteLine(g1.p1 + " to the " + g1.p2);
            Console.WriteLine();

            GFG G  = new GFG(10, 20);
            GFG G1 = new GFG(G, G);

            Console.WriteLine("Values are : {0} & {1}", G1.p3, G1.p4);

            Console.ReadLine();
        }
Example #2
0
 //copy of 2nd constrtuctor
 public GFG(GFG a, GFG b)
 {
     p3 = a.p3;
     p4 = b.p4;
 }
Example #3
0
 //copy of 1st constructor
 public GFG(GFG g)
 {
     p1 = g.p1;
     p2 = g.p2;
 }