---
title: "Discussion on \"Constructors Demystified\" | Hashnode"
description: "Discussion on \"Constructors Demystified\". What is a Constructor?\n\nA constructor is basically a function that initializes an object at the time of its creation. It looks similar to a method and is named the same as a class.\n\n// syntax of a constructor\npublic className() {\n}\nNow, what do I mea..."
url: "https://hashnode.com/posts/constructors-demystified/5fe365d6ddcb940a6d28ca23"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Constructors Demystified](https://codexposed.hashnode.dev/constructors-demystified?utm_source=hashnode&utm_medium=feed)

What is a Constructor? A constructor is basically a function that initializes an object at the time of its creation. It looks similar to a method and is named the same as a class. // syntax of a constructor public className() { } Now, what do I mea...

Dec 23, 2020 · 8 min read · codexposed.hashnode.dev  
Read the article

-   [#java](https://hashnode.com/tag/java)
-   [#programming](https://hashnode.com/tag/programming)
-   [#object-oriented-programming](https://hashnode.com/tag/object-oriented-programming)
-   [#beginners](https://hashnode.com/tag/beginners)

## Written by

[Ayan Kumar](https://hashnode.com/@Kumarayan15)

@Kumarayan15 · Purulia, India

  
[View profile](https://hashnode.com/@Kumarayan15)

Aspiring software developer

## Responses 1

Markdown supported · ⌘↵ to post

[Maxi Contieri](https://hashnode.com/@mcsee)

[Dec 23, 2020](https://hashnode.com/posts/constructors-demystified/5fe365d6ddcb940a6d28ca23/comment/5fe36696ddcb940a6d28ca39)

Awesome article

No-Parameterized constructors are a code smell of an object that will dangerously mutate.

[Ayan Kumar](https://hashnode.com/@Kumarayan15)

[Dec 23, 2020](https://hashnode.com/posts/constructors-demystified/5fe365d6ddcb940a6d28ca23/comment/5fe36696ddcb940a6d28ca39#reply-5fe367b31e6a660a92506310)

Thanks a lot Maxi
