I am trying to pass the value from child class to parent class constructor. But
class Class1
{
public Class1(int a, int b) {
this.a = a;
this.b = b;
Console.WriteLine("parentconstructor");
}
}
class Class2: Class1 {
public Class2(int a, int b): base(a, b) {
Console.WriteLine("childconstructor");
}
}
class program
{
class2 obj =new class2( 4,5);
Console.ReadLine();
}
//OUTPUT
//Parentconstructor
//childconstriuctor
// But excepted child constructor first an second parentconstructor