---
title: "What are the differences between constructor and method of a class in Java?"  
description: "What are the differences between constructor and method of a class in Java?"  
author: "Mukul Goenka"  
published: 2021-11-21  
updated: 2021-11-21  
canonical: https://www.mindstick.com/forum/156858/what-are-the-differences-between-constructor-and-method-of-a-class-in-java  
category: "java"  
tags: ["c#", "java", "methods"]  
reading_time: 2 minutes  

---

# What are the differences between constructor and method of a class in Java?

What are the [differences](https://www.mindstick.com/articles/12918/cat-5e-vs-cat-6a-understanding-the-major-differences) between constructor and [method](https://www.mindstick.com/forum/166/webservice-method) of a [class](https://www.mindstick.com/blog/165/generic-class-in-c-sharp) in [Java](https://www.mindstick.com/articles/12214/web-development-company-in-india-laid-on-the-foundation-of-concrete-java-programming)?

## Replies

### Reply by Ravi Vishwakarma

\

| **Constructor** | **Method** |
| --- | --- |
| Constructor is used for initializing the object state. \ \ | Method is used for exposing the object's behavior. |
| Constructor has no return type. Method should have a return type. | Even if it does not return anything, return type is void. |
| Constructor gets invoked implicitly. | Method has to be invoked on the object explicitly. |
| If the constructor is not defined, then a default constructor is provided by the java compiler. | If a method is not defined, then the compiler does not provide it. |
| The constructor name should be equal to the class name. | The name of the method can have any name or have a class name too. |
| Final variable instantiations are possible inside a constructor and the scope of this applies to the whole class and its objects. | A final variable if initialised inside a method ensures that the variable cant be changed only within the scope of that method. |

\


---

Original Source: https://www.mindstick.com/forum/156858/what-are-the-differences-between-constructor-and-method-of-a-class-in-java

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
