SlideShare a Scribd company logo
Big idea: Encapsulation A form of abstraction Interface: Public data Public methods Javadoc
comments Implementation: Private instance variables Private constants Private methods Bodies
of public methods
Solution
Encapsulation is a concept of OOP (Object Oriented Programming).
It is a method of wrapping the variables and methods together in a single unit. In the scenario of
encapsulation, the variables of the class will be hidden from other classes (using private
variables) and can only be accessed through the methods of current class.
Encapsulation is achieved by
(i) Declaring the variables of a class as Private
(ii) Providing public functions/methods to modify the variable values
Example:
public class Encapsulation{
private int money;
public int getMoney()
{
return money;
}
}
In the above example, the variable "money" is private and cannot be accessed by other classes
publicly. If they want to access the variable or get the value of the variable, a public function
needs to be present. Only in such a case, they can access the variable.

More Related Content

Similar to Big idea Encapsulation A form of abstraction Interface Public data .pdf

chapter 5 concepts of object oriented programming
chapter 5 concepts of object oriented programmingchapter 5 concepts of object oriented programming
chapter 5 concepts of object oriented programming
WondimuBantihun1
 
Java Core Parctical
Java Core ParcticalJava Core Parctical
Java Core Parctical
Gaurav Mehta
 
OOP in Java Presentation.pptx
OOP in Java Presentation.pptxOOP in Java Presentation.pptx
OOP in Java Presentation.pptx
mrxyz19
 
Corejavainterviewquestions.doc
Corejavainterviewquestions.docCorejavainterviewquestions.doc
Corejavainterviewquestions.doc
Joyce Thomas
 
Introduction to OOP with PHP
Introduction to OOP with PHPIntroduction to OOP with PHP
Introduction to OOP with PHP
Michael Peacock
 
Lecture 17
Lecture 17Lecture 17
Lecture 17
talha ijaz
 
Inheritance and its types In Java
Inheritance and its types In JavaInheritance and its types In Java
Inheritance and its types In Java
MD SALEEM QAISAR
 
Polymorphism in java
Polymorphism in javaPolymorphism in java
Polymorphism in java
Elizabeth alexander
 
Object oriented programming CLASSES-AND-OBJECTS.pptx
Object oriented programming CLASSES-AND-OBJECTS.pptxObject oriented programming CLASSES-AND-OBJECTS.pptx
Object oriented programming CLASSES-AND-OBJECTS.pptx
DaveEstonilo
 
Object+oriented+programming+in+java
Object+oriented+programming+in+javaObject+oriented+programming+in+java
Object+oriented+programming+in+java
Ye Win
 
Object Oriented Javascript part2
Object Oriented Javascript part2Object Oriented Javascript part2
Object Oriented Javascript part2
Usman Mehmood
 
9781439035665 ppt ch10
9781439035665 ppt ch109781439035665 ppt ch10
9781439035665 ppt ch10
Terry Yoast
 
Dev labs alliance top 20 basic java interview questions for sdet
Dev labs alliance top 20 basic java interview questions for sdetDev labs alliance top 20 basic java interview questions for sdet
Dev labs alliance top 20 basic java interview questions for sdet
DevLabs Alliance
 
Top 10 java oops interview questions
Top 10 java oops interview questionsTop 10 java oops interview questions
Top 10 java oops interview questions
nishajj
 
Top 10 java_oops_interview_questions
Top 10 java_oops_interview_questionsTop 10 java_oops_interview_questions
Top 10 java_oops_interview_questions
nishajj
 
Top 10 java_oops_interview_questions
Top 10 java_oops_interview_questionsTop 10 java_oops_interview_questions
Top 10 java_oops_interview_questions
nishajj
 
Top 10 java_oops_interview_questions
Top 10 java_oops_interview_questionsTop 10 java_oops_interview_questions
Top 10 java_oops_interview_questions
nishajj
 
Top 10 java oops interview questions
Top 10 java oops interview questionsTop 10 java oops interview questions
Top 10 java oops interview questions
nishajj
 
Top 10 java_oops_interview_questions
Top 10 java_oops_interview_questionsTop 10 java_oops_interview_questions
Top 10 java_oops_interview_questions
nishajj
 
Question and answer Programming
Question and answer ProgrammingQuestion and answer Programming
Question and answer Programming
Inocentshuja Ahmad
 

Similar to Big idea Encapsulation A form of abstraction Interface Public data .pdf (20)

chapter 5 concepts of object oriented programming
chapter 5 concepts of object oriented programmingchapter 5 concepts of object oriented programming
chapter 5 concepts of object oriented programming
 
Java Core Parctical
Java Core ParcticalJava Core Parctical
Java Core Parctical
 
OOP in Java Presentation.pptx
OOP in Java Presentation.pptxOOP in Java Presentation.pptx
OOP in Java Presentation.pptx
 
Corejavainterviewquestions.doc
Corejavainterviewquestions.docCorejavainterviewquestions.doc
Corejavainterviewquestions.doc
 
Introduction to OOP with PHP
Introduction to OOP with PHPIntroduction to OOP with PHP
Introduction to OOP with PHP
 
Lecture 17
Lecture 17Lecture 17
Lecture 17
 
Inheritance and its types In Java
Inheritance and its types In JavaInheritance and its types In Java
Inheritance and its types In Java
 
Polymorphism in java
Polymorphism in javaPolymorphism in java
Polymorphism in java
 
Object oriented programming CLASSES-AND-OBJECTS.pptx
Object oriented programming CLASSES-AND-OBJECTS.pptxObject oriented programming CLASSES-AND-OBJECTS.pptx
Object oriented programming CLASSES-AND-OBJECTS.pptx
 
Object+oriented+programming+in+java
Object+oriented+programming+in+javaObject+oriented+programming+in+java
Object+oriented+programming+in+java
 
Object Oriented Javascript part2
Object Oriented Javascript part2Object Oriented Javascript part2
Object Oriented Javascript part2
 
9781439035665 ppt ch10
9781439035665 ppt ch109781439035665 ppt ch10
9781439035665 ppt ch10
 
Dev labs alliance top 20 basic java interview questions for sdet
Dev labs alliance top 20 basic java interview questions for sdetDev labs alliance top 20 basic java interview questions for sdet
Dev labs alliance top 20 basic java interview questions for sdet
 
Top 10 java oops interview questions
Top 10 java oops interview questionsTop 10 java oops interview questions
Top 10 java oops interview questions
 
Top 10 java_oops_interview_questions
Top 10 java_oops_interview_questionsTop 10 java_oops_interview_questions
Top 10 java_oops_interview_questions
 
Top 10 java_oops_interview_questions
Top 10 java_oops_interview_questionsTop 10 java_oops_interview_questions
Top 10 java_oops_interview_questions
 
Top 10 java_oops_interview_questions
Top 10 java_oops_interview_questionsTop 10 java_oops_interview_questions
Top 10 java_oops_interview_questions
 
Top 10 java oops interview questions
Top 10 java oops interview questionsTop 10 java oops interview questions
Top 10 java oops interview questions
 
Top 10 java_oops_interview_questions
Top 10 java_oops_interview_questionsTop 10 java_oops_interview_questions
Top 10 java_oops_interview_questions
 
Question and answer Programming
Question and answer ProgrammingQuestion and answer Programming
Question and answer Programming
 

More from eyezoneamritsar

Identify 3 cell components that are shared in common between prokary.pdf
Identify 3 cell components that are shared in common between prokary.pdfIdentify 3 cell components that are shared in common between prokary.pdf
Identify 3 cell components that are shared in common between prokary.pdf
eyezoneamritsar
 
How many pairs of wires are in a standard Ethernet cableDefend or.pdf
How many pairs of wires are in a standard Ethernet cableDefend or.pdfHow many pairs of wires are in a standard Ethernet cableDefend or.pdf
How many pairs of wires are in a standard Ethernet cableDefend or.pdf
eyezoneamritsar
 
Fst can be used to measure the number of migrants per gegenetration .pdf
Fst can be used to measure the number of migrants per gegenetration .pdfFst can be used to measure the number of migrants per gegenetration .pdf
Fst can be used to measure the number of migrants per gegenetration .pdf
eyezoneamritsar
 
How visual information is sent from the eye to the rest of the brain.pdf
How visual information is sent from the eye to the rest of the brain.pdfHow visual information is sent from the eye to the rest of the brain.pdf
How visual information is sent from the eye to the rest of the brain.pdf
eyezoneamritsar
 
For coherently demodulated BPSK, what should EbN0 be in dB so as to.pdf
For coherently demodulated BPSK, what should EbN0 be in dB so as to.pdfFor coherently demodulated BPSK, what should EbN0 be in dB so as to.pdf
For coherently demodulated BPSK, what should EbN0 be in dB so as to.pdf
eyezoneamritsar
 
Cisco Systems The Supply Chain Story11. Study the networked suppl.pdf
Cisco Systems The Supply Chain Story11. Study the networked suppl.pdfCisco Systems The Supply Chain Story11. Study the networked suppl.pdf
Cisco Systems The Supply Chain Story11. Study the networked suppl.pdf
eyezoneamritsar
 
Describe four threats to high data availability and at least one mea.pdf
Describe four threats to high data availability and at least one mea.pdfDescribe four threats to high data availability and at least one mea.pdf
Describe four threats to high data availability and at least one mea.pdf
eyezoneamritsar
 
Describe the major interactions among organisms in a food web.So.pdf
Describe the major interactions among organisms in a food web.So.pdfDescribe the major interactions among organisms in a food web.So.pdf
Describe the major interactions among organisms in a food web.So.pdf
eyezoneamritsar
 
Consider the following circle of radius 5 centered at the origin. Fi.pdf
Consider the following circle of radius 5 centered at the origin.  Fi.pdfConsider the following circle of radius 5 centered at the origin.  Fi.pdf
Consider the following circle of radius 5 centered at the origin. Fi.pdf
eyezoneamritsar
 
Write one Conditional Signal Assignment VHDL code statement in the b.pdf
Write one Conditional Signal Assignment VHDL code statement in the b.pdfWrite one Conditional Signal Assignment VHDL code statement in the b.pdf
Write one Conditional Signal Assignment VHDL code statement in the b.pdf
eyezoneamritsar
 
Why are tourist destinations attempting to attract more visitors out.pdf
Why are tourist destinations attempting to attract more visitors out.pdfWhy are tourist destinations attempting to attract more visitors out.pdf
Why are tourist destinations attempting to attract more visitors out.pdf
eyezoneamritsar
 
Which pair of words are synonymsA ephemeral--evanescentB euphon.pdf
Which pair of words are synonymsA ephemeral--evanescentB euphon.pdfWhich pair of words are synonymsA ephemeral--evanescentB euphon.pdf
Which pair of words are synonymsA ephemeral--evanescentB euphon.pdf
eyezoneamritsar
 
Which of the following embryonic materials is matched with a correct.pdf
Which of the following embryonic materials is matched with a correct.pdfWhich of the following embryonic materials is matched with a correct.pdf
Which of the following embryonic materials is matched with a correct.pdf
eyezoneamritsar
 
We used 3 files with each lab project in Vivado. What do we call the.pdf
We used 3 files with each lab project in Vivado.  What do we call the.pdfWe used 3 files with each lab project in Vivado.  What do we call the.pdf
We used 3 files with each lab project in Vivado. What do we call the.pdf
eyezoneamritsar
 
To determine the distance between short and black on chromosome II th.pdf
To determine the distance between short and black on chromosome II th.pdfTo determine the distance between short and black on chromosome II th.pdf
To determine the distance between short and black on chromosome II th.pdf
eyezoneamritsar
 
High School Blues Evan and Alexia had been happily married for seven.pdf
High School Blues Evan and Alexia had been happily married for seven.pdfHigh School Blues Evan and Alexia had been happily married for seven.pdf
High School Blues Evan and Alexia had been happily married for seven.pdf
eyezoneamritsar
 
Suppose within your Web browser, you click on a link to obtain a Webp.pdf
Suppose within your Web browser, you click on a link to obtain a Webp.pdfSuppose within your Web browser, you click on a link to obtain a Webp.pdf
Suppose within your Web browser, you click on a link to obtain a Webp.pdf
eyezoneamritsar
 
Supports cukaryotic cellsSolutionEukaryotes are the organisms h.pdf
Supports cukaryotic cellsSolutionEukaryotes are the organisms h.pdfSupports cukaryotic cellsSolutionEukaryotes are the organisms h.pdf
Supports cukaryotic cellsSolutionEukaryotes are the organisms h.pdf
eyezoneamritsar
 
C# I need assitance on my code.. Im getting an error message Us.pdf
C# I need assitance on my code.. Im getting an error message Us.pdfC# I need assitance on my code.. Im getting an error message Us.pdf
C# I need assitance on my code.. Im getting an error message Us.pdf
eyezoneamritsar
 
Briefly define and describe what IASB and IFRS are.SolutionIAS.pdf
Briefly define and describe what IASB and IFRS are.SolutionIAS.pdfBriefly define and describe what IASB and IFRS are.SolutionIAS.pdf
Briefly define and describe what IASB and IFRS are.SolutionIAS.pdf
eyezoneamritsar
 

More from eyezoneamritsar (20)

Identify 3 cell components that are shared in common between prokary.pdf
Identify 3 cell components that are shared in common between prokary.pdfIdentify 3 cell components that are shared in common between prokary.pdf
Identify 3 cell components that are shared in common between prokary.pdf
 
How many pairs of wires are in a standard Ethernet cableDefend or.pdf
How many pairs of wires are in a standard Ethernet cableDefend or.pdfHow many pairs of wires are in a standard Ethernet cableDefend or.pdf
How many pairs of wires are in a standard Ethernet cableDefend or.pdf
 
Fst can be used to measure the number of migrants per gegenetration .pdf
Fst can be used to measure the number of migrants per gegenetration .pdfFst can be used to measure the number of migrants per gegenetration .pdf
Fst can be used to measure the number of migrants per gegenetration .pdf
 
How visual information is sent from the eye to the rest of the brain.pdf
How visual information is sent from the eye to the rest of the brain.pdfHow visual information is sent from the eye to the rest of the brain.pdf
How visual information is sent from the eye to the rest of the brain.pdf
 
For coherently demodulated BPSK, what should EbN0 be in dB so as to.pdf
For coherently demodulated BPSK, what should EbN0 be in dB so as to.pdfFor coherently demodulated BPSK, what should EbN0 be in dB so as to.pdf
For coherently demodulated BPSK, what should EbN0 be in dB so as to.pdf
 
Cisco Systems The Supply Chain Story11. Study the networked suppl.pdf
Cisco Systems The Supply Chain Story11. Study the networked suppl.pdfCisco Systems The Supply Chain Story11. Study the networked suppl.pdf
Cisco Systems The Supply Chain Story11. Study the networked suppl.pdf
 
Describe four threats to high data availability and at least one mea.pdf
Describe four threats to high data availability and at least one mea.pdfDescribe four threats to high data availability and at least one mea.pdf
Describe four threats to high data availability and at least one mea.pdf
 
Describe the major interactions among organisms in a food web.So.pdf
Describe the major interactions among organisms in a food web.So.pdfDescribe the major interactions among organisms in a food web.So.pdf
Describe the major interactions among organisms in a food web.So.pdf
 
Consider the following circle of radius 5 centered at the origin. Fi.pdf
Consider the following circle of radius 5 centered at the origin.  Fi.pdfConsider the following circle of radius 5 centered at the origin.  Fi.pdf
Consider the following circle of radius 5 centered at the origin. Fi.pdf
 
Write one Conditional Signal Assignment VHDL code statement in the b.pdf
Write one Conditional Signal Assignment VHDL code statement in the b.pdfWrite one Conditional Signal Assignment VHDL code statement in the b.pdf
Write one Conditional Signal Assignment VHDL code statement in the b.pdf
 
Why are tourist destinations attempting to attract more visitors out.pdf
Why are tourist destinations attempting to attract more visitors out.pdfWhy are tourist destinations attempting to attract more visitors out.pdf
Why are tourist destinations attempting to attract more visitors out.pdf
 
Which pair of words are synonymsA ephemeral--evanescentB euphon.pdf
Which pair of words are synonymsA ephemeral--evanescentB euphon.pdfWhich pair of words are synonymsA ephemeral--evanescentB euphon.pdf
Which pair of words are synonymsA ephemeral--evanescentB euphon.pdf
 
Which of the following embryonic materials is matched with a correct.pdf
Which of the following embryonic materials is matched with a correct.pdfWhich of the following embryonic materials is matched with a correct.pdf
Which of the following embryonic materials is matched with a correct.pdf
 
We used 3 files with each lab project in Vivado. What do we call the.pdf
We used 3 files with each lab project in Vivado.  What do we call the.pdfWe used 3 files with each lab project in Vivado.  What do we call the.pdf
We used 3 files with each lab project in Vivado. What do we call the.pdf
 
To determine the distance between short and black on chromosome II th.pdf
To determine the distance between short and black on chromosome II th.pdfTo determine the distance between short and black on chromosome II th.pdf
To determine the distance between short and black on chromosome II th.pdf
 
High School Blues Evan and Alexia had been happily married for seven.pdf
High School Blues Evan and Alexia had been happily married for seven.pdfHigh School Blues Evan and Alexia had been happily married for seven.pdf
High School Blues Evan and Alexia had been happily married for seven.pdf
 
Suppose within your Web browser, you click on a link to obtain a Webp.pdf
Suppose within your Web browser, you click on a link to obtain a Webp.pdfSuppose within your Web browser, you click on a link to obtain a Webp.pdf
Suppose within your Web browser, you click on a link to obtain a Webp.pdf
 
Supports cukaryotic cellsSolutionEukaryotes are the organisms h.pdf
Supports cukaryotic cellsSolutionEukaryotes are the organisms h.pdfSupports cukaryotic cellsSolutionEukaryotes are the organisms h.pdf
Supports cukaryotic cellsSolutionEukaryotes are the organisms h.pdf
 
C# I need assitance on my code.. Im getting an error message Us.pdf
C# I need assitance on my code.. Im getting an error message Us.pdfC# I need assitance on my code.. Im getting an error message Us.pdf
C# I need assitance on my code.. Im getting an error message Us.pdf
 
Briefly define and describe what IASB and IFRS are.SolutionIAS.pdf
Briefly define and describe what IASB and IFRS are.SolutionIAS.pdfBriefly define and describe what IASB and IFRS are.SolutionIAS.pdf
Briefly define and describe what IASB and IFRS are.SolutionIAS.pdf
 

Recently uploaded

South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)
Academy of Science of South Africa
 
PIMS Job Advertisement 2024.pdf Islamabad
PIMS Job Advertisement 2024.pdf IslamabadPIMS Job Advertisement 2024.pdf Islamabad
PIMS Job Advertisement 2024.pdf Islamabad
AyyanKhan40
 
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
PECB
 
Wound healing PPT
Wound healing PPTWound healing PPT
Wound healing PPT
Jyoti Chand
 
How to Manage Your Lost Opportunities in Odoo 17 CRM
How to Manage Your Lost Opportunities in Odoo 17 CRMHow to Manage Your Lost Opportunities in Odoo 17 CRM
How to Manage Your Lost Opportunities in Odoo 17 CRM
Celine George
 
How to Setup Warehouse & Location in Odoo 17 Inventory
How to Setup Warehouse & Location in Odoo 17 InventoryHow to Setup Warehouse & Location in Odoo 17 Inventory
How to Setup Warehouse & Location in Odoo 17 Inventory
Celine George
 
Pengantar Penggunaan Flutter - Dart programming language1.pptx
Pengantar Penggunaan Flutter - Dart programming language1.pptxPengantar Penggunaan Flutter - Dart programming language1.pptx
Pengantar Penggunaan Flutter - Dart programming language1.pptx
Fajar Baskoro
 
spot a liar (Haiqa 146).pptx Technical writhing and presentation skills
spot a liar (Haiqa 146).pptx Technical writhing and presentation skillsspot a liar (Haiqa 146).pptx Technical writhing and presentation skills
spot a liar (Haiqa 146).pptx Technical writhing and presentation skills
haiqairshad
 
BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...
BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...
BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...
Nguyen Thanh Tu Collection
 
A Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdfA Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdf
Jean Carlos Nunes Paixão
 
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
Nguyen Thanh Tu Collection
 
How to Create a More Engaging and Human Online Learning Experience
How to Create a More Engaging and Human Online Learning Experience How to Create a More Engaging and Human Online Learning Experience
How to Create a More Engaging and Human Online Learning Experience
Wahiba Chair Training & Consulting
 
The History of Stoke Newington Street Names
The History of Stoke Newington Street NamesThe History of Stoke Newington Street Names
The History of Stoke Newington Street Names
History of Stoke Newington
 
LAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UP
LAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UPLAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UP
LAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UP
RAHUL
 
BBR 2024 Summer Sessions Interview Training
BBR  2024 Summer Sessions Interview TrainingBBR  2024 Summer Sessions Interview Training
BBR 2024 Summer Sessions Interview Training
Katrina Pritchard
 
UGC NET Exam Paper 1- Unit 1:Teaching Aptitude
UGC NET Exam Paper 1- Unit 1:Teaching AptitudeUGC NET Exam Paper 1- Unit 1:Teaching Aptitude
UGC NET Exam Paper 1- Unit 1:Teaching Aptitude
S. Raj Kumar
 
Hindi varnamala | hindi alphabet PPT.pdf
Hindi varnamala | hindi alphabet PPT.pdfHindi varnamala | hindi alphabet PPT.pdf
Hindi varnamala | hindi alphabet PPT.pdf
Dr. Mulla Adam Ali
 
How to deliver Powerpoint Presentations.pptx
How to deliver Powerpoint  Presentations.pptxHow to deliver Powerpoint  Presentations.pptx
How to deliver Powerpoint Presentations.pptx
HajraNaeem15
 
NEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptx
NEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptxNEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptx
NEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptx
iammrhaywood
 
clinical examination of hip joint (1).pdf
clinical examination of hip joint (1).pdfclinical examination of hip joint (1).pdf
clinical examination of hip joint (1).pdf
Priyankaranawat4
 

Recently uploaded (20)

South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)
 
PIMS Job Advertisement 2024.pdf Islamabad
PIMS Job Advertisement 2024.pdf IslamabadPIMS Job Advertisement 2024.pdf Islamabad
PIMS Job Advertisement 2024.pdf Islamabad
 
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
 
Wound healing PPT
Wound healing PPTWound healing PPT
Wound healing PPT
 
How to Manage Your Lost Opportunities in Odoo 17 CRM
How to Manage Your Lost Opportunities in Odoo 17 CRMHow to Manage Your Lost Opportunities in Odoo 17 CRM
How to Manage Your Lost Opportunities in Odoo 17 CRM
 
How to Setup Warehouse & Location in Odoo 17 Inventory
How to Setup Warehouse & Location in Odoo 17 InventoryHow to Setup Warehouse & Location in Odoo 17 Inventory
How to Setup Warehouse & Location in Odoo 17 Inventory
 
Pengantar Penggunaan Flutter - Dart programming language1.pptx
Pengantar Penggunaan Flutter - Dart programming language1.pptxPengantar Penggunaan Flutter - Dart programming language1.pptx
Pengantar Penggunaan Flutter - Dart programming language1.pptx
 
spot a liar (Haiqa 146).pptx Technical writhing and presentation skills
spot a liar (Haiqa 146).pptx Technical writhing and presentation skillsspot a liar (Haiqa 146).pptx Technical writhing and presentation skills
spot a liar (Haiqa 146).pptx Technical writhing and presentation skills
 
BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...
BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...
BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...
 
A Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdfA Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdf
 
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
 
How to Create a More Engaging and Human Online Learning Experience
How to Create a More Engaging and Human Online Learning Experience How to Create a More Engaging and Human Online Learning Experience
How to Create a More Engaging and Human Online Learning Experience
 
The History of Stoke Newington Street Names
The History of Stoke Newington Street NamesThe History of Stoke Newington Street Names
The History of Stoke Newington Street Names
 
LAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UP
LAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UPLAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UP
LAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UP
 
BBR 2024 Summer Sessions Interview Training
BBR  2024 Summer Sessions Interview TrainingBBR  2024 Summer Sessions Interview Training
BBR 2024 Summer Sessions Interview Training
 
UGC NET Exam Paper 1- Unit 1:Teaching Aptitude
UGC NET Exam Paper 1- Unit 1:Teaching AptitudeUGC NET Exam Paper 1- Unit 1:Teaching Aptitude
UGC NET Exam Paper 1- Unit 1:Teaching Aptitude
 
Hindi varnamala | hindi alphabet PPT.pdf
Hindi varnamala | hindi alphabet PPT.pdfHindi varnamala | hindi alphabet PPT.pdf
Hindi varnamala | hindi alphabet PPT.pdf
 
How to deliver Powerpoint Presentations.pptx
How to deliver Powerpoint  Presentations.pptxHow to deliver Powerpoint  Presentations.pptx
How to deliver Powerpoint Presentations.pptx
 
NEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptx
NEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptxNEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptx
NEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptx
 
clinical examination of hip joint (1).pdf
clinical examination of hip joint (1).pdfclinical examination of hip joint (1).pdf
clinical examination of hip joint (1).pdf
 

Big idea Encapsulation A form of abstraction Interface Public data .pdf

  • 1. Big idea: Encapsulation A form of abstraction Interface: Public data Public methods Javadoc comments Implementation: Private instance variables Private constants Private methods Bodies of public methods Solution Encapsulation is a concept of OOP (Object Oriented Programming). It is a method of wrapping the variables and methods together in a single unit. In the scenario of encapsulation, the variables of the class will be hidden from other classes (using private variables) and can only be accessed through the methods of current class. Encapsulation is achieved by (i) Declaring the variables of a class as Private (ii) Providing public functions/methods to modify the variable values Example: public class Encapsulation{ private int money; public int getMoney() { return money; } } In the above example, the variable "money" is private and cannot be accessed by other classes publicly. If they want to access the variable or get the value of the variable, a public function needs to be present. Only in such a case, they can access the variable.