SlideShare a Scribd company logo
Encapsulation in java | ehsanullah
ENCAPSULATION IN JAVA
• ENCAPSULATION IN JAVA IS A MECHANISM OF WRAPPING THE DATA(VARIABLE)
AND CODE ACTING ON THE DATA (METHODS) TOGETHER AS A SINGLE UNIT.
ENCAPSULATION IN JAVA
• ENCAPSULATION IS ONE OF THE FOUR FUNDAMENTAL OOP CONCEPTS.
• IT IS ALSO KNOWN AS DATA HIDING.
ENCAPSULATION IN JAVA
• IN THIS DECLARE THE VARIABLES AS PRIVATE.
• PROVIDE PUBLIC SETTER AND GETTER METHODS TO MODIFY AND VIEW THE
VARIABLES VALUES.
BENEFITS ENCAPSULATION IN JAVA
• THE FIELD OF A CLASS CAN BE MADE READ ONLY ARE WRITE ONLY.
• A CLASS CAN HAVE TOTAL CONTROL OVER WHAT IS STORED IN ITS FIELDS.

More Related Content

PDF
Storytelling For The Web: Integrate Storytelling in your Design Process
PDF
2024 Trend Updates: What Really Works In SEO & Content Marketing
PPTX
ArrayList in JAVA
PPTX
1. Java Collections Framework Introduction
PPTX
Static and dynamic binding in java | ehsanullah
PPTX
Abstract class in java
PPTX
Project integration management
PPTX
Intro to project management
Storytelling For The Web: Integrate Storytelling in your Design Process
2024 Trend Updates: What Really Works In SEO & Content Marketing
ArrayList in JAVA
1. Java Collections Framework Introduction
Static and dynamic binding in java | ehsanullah
Abstract class in java
Project integration management
Intro to project management

Recently uploaded (20)

PPTX
Cell Structure & Organelles in detailed.
PPTX
Pharma ospi slides which help in ospi learning
PDF
STATICS OF THE RIGID BODIES Hibbelers.pdf
PPTX
Microbial diseases, their pathogenesis and prophylaxis
PDF
Module 4: Burden of Disease Tutorial Slides S2 2025
PPTX
Renaissance Architecture: A Journey from Faith to Humanism
PDF
RMMM.pdf make it easy to upload and study
PDF
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf
PDF
O7-L3 Supply Chain Operations - ICLT Program
PPTX
Pharmacology of Heart Failure /Pharmacotherapy of CHF
PDF
2.FourierTransform-ShortQuestionswithAnswers.pdf
PPTX
Introduction_to_Human_Anatomy_and_Physiology_for_B.Pharm.pptx
PPTX
master seminar digital applications in india
PPTX
Lesson notes of climatology university.
PDF
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
PDF
O5-L3 Freight Transport Ops (International) V1.pdf
PDF
FourierSeries-QuestionsWithAnswers(Part-A).pdf
PDF
Anesthesia in Laparoscopic Surgery in India
PPTX
human mycosis Human fungal infections are called human mycosis..pptx
PDF
Basic Mud Logging Guide for educational purpose
Cell Structure & Organelles in detailed.
Pharma ospi slides which help in ospi learning
STATICS OF THE RIGID BODIES Hibbelers.pdf
Microbial diseases, their pathogenesis and prophylaxis
Module 4: Burden of Disease Tutorial Slides S2 2025
Renaissance Architecture: A Journey from Faith to Humanism
RMMM.pdf make it easy to upload and study
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf
O7-L3 Supply Chain Operations - ICLT Program
Pharmacology of Heart Failure /Pharmacotherapy of CHF
2.FourierTransform-ShortQuestionswithAnswers.pdf
Introduction_to_Human_Anatomy_and_Physiology_for_B.Pharm.pptx
master seminar digital applications in india
Lesson notes of climatology university.
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
O5-L3 Freight Transport Ops (International) V1.pdf
FourierSeries-QuestionsWithAnswers(Part-A).pdf
Anesthesia in Laparoscopic Surgery in India
human mycosis Human fungal infections are called human mycosis..pptx
Basic Mud Logging Guide for educational purpose
Ad
Ad

Encapsulation in java | ehsanullah

  • 2. ENCAPSULATION IN JAVA • ENCAPSULATION IN JAVA IS A MECHANISM OF WRAPPING THE DATA(VARIABLE) AND CODE ACTING ON THE DATA (METHODS) TOGETHER AS A SINGLE UNIT.
  • 3. ENCAPSULATION IN JAVA • ENCAPSULATION IS ONE OF THE FOUR FUNDAMENTAL OOP CONCEPTS. • IT IS ALSO KNOWN AS DATA HIDING.
  • 4. ENCAPSULATION IN JAVA • IN THIS DECLARE THE VARIABLES AS PRIVATE. • PROVIDE PUBLIC SETTER AND GETTER METHODS TO MODIFY AND VIEW THE VARIABLES VALUES.
  • 5. BENEFITS ENCAPSULATION IN JAVA • THE FIELD OF A CLASS CAN BE MADE READ ONLY ARE WRITE ONLY. • A CLASS CAN HAVE TOTAL CONTROL OVER WHAT IS STORED IN ITS FIELDS.