Like this:
public class DerivedClass : BaseClass
{
public DerivedClass(int derivedParam, String baseParam):base(baseParam)
{
}
}
The base
keyword here calls the base class constructor that matches the provided parameter overload.
More Related Contents:
- I am finding it hard to understand inheritance in C# [closed]
- static void Main(string[] args) [closed]
- C# Inheritance, adding new methods [closed]
- C# constructor execution order
- Reflection: How to Invoke Method with parameters
- What is the use of “ref” for reference-type variables in C#?
- Inheritance from multiple interfaces with the same method name
- C# Error: Parent does not contain a constructor that takes 0 arguments
- Inheriting from List
- Why can’t I call an extension method from a base class of the extended type?
- Passing just a type as a parameter in C#
- Is there a reasonable approach to “default” type parameters in C# Generics?
- Interesting “params of ref” feature, any workarounds?
- C# – Making all derived classes call the base class constructor
- Why can’t I create an abstract constructor on an abstract C# class?
- What’s the difference between using the Serializable attribute & implementing ISerializable?
- Why are constructors not inherited in C#?
- How to check if a class inherits another class without instantiating it? [duplicate]
- Inheriting comments from an interface in an implementing class?
- “this” in function parameter
- Entity Framework DB-First, implement inheritance
- Oracle Parameters with IN statement?
- Can I Override with derived types?
- problem using Oracle parameters in SELECT IN
- How to inherit constructors?
- Call base function then inherited function
- Calling an overridden method from a parent class ctor
- Automatically making Base Constructors available in derived class?
- Get derived class type from a base’s class static method
- cast the Parent object to Child object in C#