---
title: "Discussion on \"Encapsulation\" | Hashnode"
description: "Discussion on \"Encapsulation\". Introduction\nEncapsulation means wrapping code and data together into a single unit. Encapsulation is also used for data hiding. But the main purpose of encapsulation is to bind the data together in a single unit. \nclass Area {\n\n  // fields to calcul..."
url: "https://hashnode.com/posts/encapsulation/624c7ad624471c433062bfec"
---

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

Discussion

# [Encapsulation](https://mariamchaudhary.hashnode.dev/encapsulation?utm_source=hashnode&utm_medium=feed)

Introduction Encapsulation means wrapping code and data together into a single unit. Encapsulation is also used for data hiding. But the main purpose of encapsulation is to bind the data together in a single unit. class Area { // fields to calcul...

Apr 5, 2022 · 2 min read · mariamchaudhary.hashnode.dev  
Read the article

-   [#java](https://hashnode.com/tag/java)
-   [#oop](https://hashnode.com/tag/oop)
-   [#oops](https://hashnode.com/tag/oops)
-   [#programming-blogs](https://hashnode.com/tag/programming-blogs)
-   [#programming-languages](https://hashnode.com/tag/programming-languages)

## Written by

[Mariam Hameed](https://hashnode.com/@mariamChaudhry)

@mariamChaudhry · Islamabad, Pakistan

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

Programmer | Pencil Artist | Love to Learn New Things

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
