---
title: "Discussion on \"What actually happens when an object of a  class is created  in Java ?\" | Hashnode"
description: "Discussion on \"What actually happens when an object of a  class is created  in Java ?\". class Student{\n    public static void main(String [] args){\n        Student s1; // Reference s1 is created in the stack\n        s1 = new Studnet(); // Mermory is allocated to s1 in heap\n    }\n}\n\n\nThe first statement states that reference (s1) is crea..."
url: "https://hashnode.com/posts/what-actually-happens-when-an-object-of-a-class-is-created-in-java/63cd877b06baa8853afa2c1d"
---

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

Discussion

# [What actually happens when an object of a class is created in Java ?](https://codetrekclub.hashnode.dev/what-actually-happens-when-an-object-of-a-class-is-created-in-java?utm_source=hashnode&utm_medium=feed)

class Student{ public static void main(String \[\] args){ Student s1; // Reference s1 is created in the stack s1 = new Studnet(); // Mermory is allocated to s1 in heap } } The first statement states that reference (s1) is crea...

Jan 22, 2023 · 1 min read · codetrekclub.hashnode.dev  
Read the article

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

## Written by

[Rakesh Kumar](https://hashnode.com/@imrakesh0827)

@imrakesh0827 · India, Darbhanga

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

Software Developer

Software Developer with 2+ years of experience at Kavayah IT Solutions, Hyderabad, specializing in building efficient, scalable, and user-friendly software applications. Skilled in .NET, C#, ASP.NET Core, Blazor, SQL Server, and modern web technologies. I enjoy solving complex problems, writing clean and maintainable code, and developing practical solutions that deliver real business value. I am currently seeking new opportunities where I can leverage my technical skills, continue learning, collaborate with talented teams, and contribute to impactful software development projects.

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
