Base Class Initilization is a concept from which we can call


method,properties and indexers of the class.We can also call the parent


class methos and also initilize the value in the parameter of parent class


construtor....

using System; 
using System.Collections.Generic;
using System.Text;
 
namespace ConsoleApplication2 {     public class Program     {         public Program(int a, int b)         {             Console.WriteLine("This is [A] Method.....");             Console.WriteLine(a + " " + b);         }  
        public void show()         {             Console.WriteLine("This will be call by base class....");         }     }  
    public class Progrram2 : Program     {         public Progrram2()             : base(10, 20)         {  
        }  
        public void B()         {             base.show();             Console.WriteLine("This is [B] Method.....");         }     }  
    class right     {         public static void Main()         {             Progrram2 p2 = new Progrram2();             p2.B();         }     } }

 

  Modified On Sep-18-2014 01:23:54 PM

Leave Comment