I am getting these 2 compiler errors :-
"There is no argument given that corresponds to the required parameter 'mark' of 'ParentClass.ParentClass(int)."
"'ChildInheritedClass' does not contain a constructor that takes 1 arguments."
Please let me know why this is happening.
using System;
namespace Fundas
{
class ParentClass
{
int mark;
public ParentClass(int mark)
{
this.mark = mark;
}
public void ParentClassMeth()
{
int perc = this.mark / 100;
Console.WriteLine("The Percentage Obtained is : {0}", perc);
}
}
class ChildInheritedClass : ParentClass
{
static void Main(string[] args)
{
ChildInheritedClass obj = new ChildInheritedClass(600);
obj.ParentClassMeth();
}
}
}