---
title: "What is a constructor?"  
description: "What is a constructor?"  
author: "Anonymous User"  
published: 2014-09-22  
updated: 2020-09-22  
canonical: https://www.mindstick.com/interview/2186/what-is-a-constructor  
category: "java"  
tags: ["c#", "java"]  
reading_time: 1 minute  

---

# What is a constructor?

**A constructor** is the method of a class that is called when an object of that class is created. The constructor initializes class parameters and has the same name as the class.constructor returns the reference id of class.

## Answers

### Answer by Anonymous User

**A constructor** is the method of a class that is called when an object of that class is created. The constructor initializes class parameters and has the same name as the class.constructor returns the reference id of class.


---

Original Source: https://www.mindstick.com/interview/2186/what-is-a-constructor

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
