---
title: "How to call a base constructor in C#?"  
description: "How to call a base constructor in C#?"  
author: "Steilla Mitchel"  
published: 2023-07-12  
updated: 2023-07-13  
canonical: https://www.mindstick.com/forum/159048/how-to-call-a-base-constructor-in-c-sharp  
category: "c#"  
tags: ["c#", "class"]  
reading_time: 1 minute  

---

# How to call a base constructor in C#?

How to call a [base](https://www.mindstick.com/articles/12627/how-can-predictive-analytics-enhance-customer-base-and-experience) [constructor in C#](https://www.mindstick.com/forum/255/constructor-in-c-sharp)?

## Replies

### Reply by Aryan Kumar

To call a base constructor in C#, you can use the `base()` keyword. The `base()` keyword takes the parameters of the base constructor as a parameter.

For example, the following code calls the `BaseClass()` constructor from the `DerivedClass()` constructor:

C#

```plaintext
class BaseClass
{
    public BaseClass()
    {
        // This is the base class constructor.
    }
}

class DerivedClass : BaseClass
{
    public DerivedClass()
    {
        // This constructor calls the base class constructor.
        base();

        // This constructor also does other things.
    }
}
```

When the `DerivedClass()` constructor is called, the `base()` keyword calls the `BaseClass()` constructor first. Then, the `DerivedClass()` constructor does other things.

Here is an explanation of the code:

- The `base()` keyword is used to call the `BaseClass()` constructor.
- The `BaseClass()` constructor is the base class constructor for the `DerivedClass` class.
- The `DerivedClass()` constructor takes no parameters.
- The `DerivedClass()` constructor calls the `base()` keyword to call the `BaseClass()` constructor.
- The `DerivedClass()` constructor also does other things.


---

Original Source: https://www.mindstick.com/forum/159048/how-to-call-a-base-constructor-in-c-sharp

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
