---
title: "How i can define a Constructor"  
description: "How i can define a Constructor"  
author: "Niraj Kumar Mishra"  
published: 2017-08-22  
updated: 2020-09-18  
canonical: https://www.mindstick.com/interview/23285/how-i-can-define-a-constructor  
category: "c#"  
tags: ["c#"]  
reading_time: 1 minute  

---

# How i can define a Constructor

when you want to define a constructor in your Program then you follow these rules.

• A constructor must have the same name as the class name.

• A constructor does not return anything, not even a void type.

• A constructor may take zero or more arguments.

• By default, the compiler provides a no-argument constructor.

• If you provide any constructor in your program then compiler does not provide a default constructor.

## Answers

### Answer by Niraj Kumar Mishra

when you want to define a constructor in your Program then you follow these rules.

• A constructor must have the same name as the class name.

• A constructor does not return anything, not even a void type.

• A constructor may take zero or more arguments.

• By default, the compiler provides a no-argument constructor.

• If you provide any constructor in your program then compiler does not provide a default constructor.


---

Original Source: https://www.mindstick.com/interview/23285/how-i-can-define-a-constructor

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
