I'm just trying to understand how Inheritance works in C#. (even though I think I got it, I want to try to do something practical in order to understand)
So I've been trying to create a class with a property and a constructor and another one which inherits this one. But I get an error and I don't really seem to get why.
using System;
using System.Collections.Generic;
using System.Text;
namespace ConsoleApp2
{
public class Test
{
public int testing { get; }
public Test(int p)
{
this.testing = p;
}
}
public class Test2 : Test {
}
}
There is no argument given that corresponds to the required formal parameter 'p' of 'Test.Test(int)' for line 15
Can someone help me understand what's happening and why do I get that error? Thanks.