Instead of asking such questions, it would be much more useful to read some manual on programming.
Your main problem is writing gibberish like
public class1(int k, int l) {}
, which does not makes sense at all. There is no a class with such name, so you cannot try to write a constructor
class1
for it.
Now, let's look at the problem with parameterless constructor. You just need to read compilation error information and understand it; it is quite straightforward. As soon as you created a constructor with parameters for the class
Program
, you loose your parameterless constructor which otherwise would be assumed for this class by default. When you create your derived class (by the way, you don't use the inheritance in any way in your derived class), you don't create any constructors at all. In contrast to the base class, it assumes that there is a parameterless constructor. One problem is implicit call of this constructor which would happen when you instantiate this class. Another rule is the implicit call of the constructor of the base class, which could only be done if your base class also had parameterless constructor, but you effectively removed it by declaring another constructor.
So, you need to modify your code to remove this inconsistency. One possibility is to add a parameterless constructor to the base class (even the one doing nothing would work):
public class Program {
public Program(int i, int j) {
Console.WriteLine("hello");
}
protected Program() {}
}
Another possibility is to modify the derived class:
public class DerivedClass {
internal DerivedClass() : base(0, 0) : { }
}
—SA