Introduction
In C#, constructors are special methods used to initialize an object when it is created. When a class has multiple constructors, you may need one constructor to reuse another instead of duplicating initialization logic.
C# provides two constructor-chaining keywords for this purpose:
this(...)— calls another constructor in the same class.base(...)— calls a constructor in the parent class.
Both are used for constructor chaining, but they work at different levels. The following Library System example shows how they work step by step.
Using this(...) to Chain Constructors in the Same Class
Consider a Book class. Every book has a title, while author and price are optional pieces of information.
Without constructor chaining, you could repeat the title initialization in every constructor. Using this(...) allows the constructors to reuse existing initialization logic.
Step 1: Create a Book Class
public class Book
{
public string Title { get; }
public string Author { get; }
public decimal Price { get; }
// Constructor 1: Only title
public Book(string title)
{
Title = title;
Console.WriteLine($"Book created: {Title}");
}
// Constructor 2: Title + Author
public Book(string title, string author) : this(title)
{
Author = author;
Console.WriteLine($"Book by {Author}");
}
// Constructor 3: Title + Author + Price
public Book(string title, string author, decimal price) : this(title, author)
{
Price = price;
Console.WriteLine($"Price: {Price:C}");
}
}
The important part is the constructor declaration:
public Book(string title, string author) : this(title)
Here, this(title) tells C# to execute the Book(string title) constructor before executing the body of the current constructor.
Similarly:
public Book(string title, string author, decimal price) : this(title, author)
calls the two-parameter constructor first.
Step 2: Create Book Objects
var b1 = new Book("Clean Code");
var b2 = new Book(
"Clean Architecture",
"Robert C. Martin");
var b3 = new Book(
"Refactoring",
"Martin Fowler",
45.50m);
Output
Book created: Clean Code
Book created: Clean Architecture
Book by Robert C. Martin
Book created: Refactoring
Book by Martin Fowler
Price: $45.50
For b3, the execution order is:
Book(title, author, price)
↓
this(title, author)
↓
this(title)
↓
Constructor body
This means the title initialization is written only once.
Why Use this(...)?
The primary benefit is avoiding duplicated constructor initialization logic.
For example, instead of writing:
public Book(string title, string author)
{
Title = title;
Author = author;
}
public Book(string title, string author, decimal price)
{
Title = title;
Author = author;
Price = price;
}
you can reuse the existing constructor:
public Book(string title, string author, decimal price)
: this(title, author)
{
Price = price;
}
This makes the initialization flow easier to maintain.
Using base(...) to Call a Parent Constructor
Now suppose the library also provides digital books.
A DigitalBook is still a Book, so it needs the properties and initialization defined by Book. At the same time, it has additional properties such as file format and file size.
This is where base(...) is useful.
Step 1: Create a DigitalBook Class
public class DigitalBook : Book
{
public string Format { get; }
public double FileSizeMB { get; }
public DigitalBook(
string title,
string author,
decimal price,
string format,
double fileSize)
: base(title, author, price)
{
Format = format;
FileSizeMB = fileSize;
Console.WriteLine(
$"Digital format: {Format}, Size: {FileSizeMB}MB");
}
}
The following part is responsible for calling the parent constructor:
: base(title, author, price)
It invokes this constructor from the Book class:
public Book(string title, string author, decimal price)
The Book constructor therefore initializes the inherited state before the DigitalBook constructor initializes its own properties.
Step 2: Create a DigitalBook Object
var ebook = new DigitalBook(
"Domain-Driven Design",
"Eric Evans",
55m,
"PDF",
5.2);
Output
Book created: Domain-Driven Design
Book by Eric Evans
Price: $55.00
Digital format: PDF, Size: 5.2MB
The execution flow is:
DigitalBook constructor
↓
base(title, author, price)
↓
Book(title, author, price)
↓
this(title, author)
↓
this(title)
↓
DigitalBook constructor body
This demonstrates that constructor chaining can work across both inheritance and overloaded constructors.
this(...) vs base(...)
Although both keywords are used for constructor chaining, they have different purposes.

Join the conversation! Your thoughts help the community grow.