Call parent constructor from abstract class : Constructor « Reflection « C# / CSharp Tutorial






using System;
  public class HelloWorld 
  {
    public static void Main() 
    {
      Person hs = new Person("Hitesh","Seth");
      Console.WriteLine(hs.GetFullName());
    }
  }
  abstract public class Abstract
  {
    protected string FirstName, LastName;
    public Abstract(string FirstName, string LastName) 
    {
      this.FirstName = FirstName;
      this.LastName = LastName;
    }
    abstract public string GetFullName();
  }
  public class Person : Abstract 
  {
    public Person(string FirstName, string LastName) : base(FirstName, LastName) 
    {    
    }
    public override string GetFullName() 
    {
      return FirstName+"."+LastName;
    }
  }








19.3.Constructor
19.3.1.Get constructor information: Display return type, name and parameters
19.3.2.Find matching constructor
19.3.3.Dynamically invoking constructors
19.3.4.Utilize MyClass without assuming any prior knowledge: invoke constructor
19.3.5.Using a ConstructorInfo to create new instance
19.3.6.Call parent constructor from abstract class
19.3.7.Get the ConstructorInfo object matching the specified binding flags, and displays the signature of the constructor.