SlideShare une entreprise Scribd logo
1  sur  1
Explain the difference between private and proctected members of a class.
Solution
Hi, I am explaning difference between private and public in context of Java Programing
Language(since you have not mentioned any Programing Language).
private : Members marked private can not be accessed by code in any class other than the class
in which the priavte member was declared.
- A private member is invisible to any code outside the member's own class.
- When a member(function) is declared private, a subclass can not inherit it.
protected :Â Â Members marked protected can be accessed by a subclass(child class) even if the
subclass is in a different package.

Contenu connexe

Plus de rtodd432

Explain the reasons why chloride ions (Cl-) is detrimental to corrosio.docx
Explain the reasons why chloride ions (Cl-) is detrimental to corrosio.docxExplain the reasons why chloride ions (Cl-) is detrimental to corrosio.docx
Explain the reasons why chloride ions (Cl-) is detrimental to corrosio.docxrtodd432
 
Explain the purpose of a data member-SolutionAnswer Data Member It is.docx
Explain the purpose of a data member-SolutionAnswer Data Member It is.docxExplain the purpose of a data member-SolutionAnswer Data Member It is.docx
Explain the purpose of a data member-SolutionAnswer Data Member It is.docxrtodd432
 
Explain the function of the following methods in LinkedList 1- addFirs.docx
Explain the function of the following methods in LinkedList 1- addFirs.docxExplain the function of the following methods in LinkedList 1- addFirs.docx
Explain the function of the following methods in LinkedList 1- addFirs.docxrtodd432
 
Explain the motivation behind using a header file for a C program-Solu.docx
Explain the motivation behind using a header file for a C program-Solu.docxExplain the motivation behind using a header file for a C program-Solu.docx
Explain the motivation behind using a header file for a C program-Solu.docxrtodd432
 
Explain the effect doping towards an intrinsic silicon- Give one examp.docx
Explain the effect doping towards an intrinsic silicon- Give one examp.docxExplain the effect doping towards an intrinsic silicon- Give one examp.docx
Explain the effect doping towards an intrinsic silicon- Give one examp.docxrtodd432
 
Explain how goverment deficit lead to increases in the money supply-.docx
Explain how goverment deficit lead to increases in the money supply-.docxExplain how goverment deficit lead to increases in the money supply-.docx
Explain how goverment deficit lead to increases in the money supply-.docxrtodd432
 
Explain how doping Si allows you to transport charges in a detector-So.docx
Explain how doping Si allows you to transport charges in a detector-So.docxExplain how doping Si allows you to transport charges in a detector-So.docx
Explain how doping Si allows you to transport charges in a detector-So.docxrtodd432
 
Explain how an --interest group-- (or --special interest group--) may.docx
Explain how an --interest group-- (or --special interest group--) may.docxExplain how an --interest group-- (or --special interest group--) may.docx
Explain how an --interest group-- (or --special interest group--) may.docxrtodd432
 
Explain how stock price volatility is more likely to imply risk than e.docx
Explain how stock price volatility is more likely to imply risk than e.docxExplain how stock price volatility is more likely to imply risk than e.docx
Explain how stock price volatility is more likely to imply risk than e.docxrtodd432
 
Explain the concept entropy Explain the concept entropySolutionAnswe.docx
Explain the concept entropy   Explain the concept entropySolutionAnswe.docxExplain the concept entropy   Explain the concept entropySolutionAnswe.docx
Explain the concept entropy Explain the concept entropySolutionAnswe.docxrtodd432
 
Explain how would you determine a covalent bond compounds bond using L.docx
Explain how would you determine a covalent bond compounds bond using L.docxExplain how would you determine a covalent bond compounds bond using L.docx
Explain how would you determine a covalent bond compounds bond using L.docxrtodd432
 
Expansive (swelling) clays exist in various areas across North America.docx
Expansive (swelling) clays exist in various areas across North America.docxExpansive (swelling) clays exist in various areas across North America.docx
Expansive (swelling) clays exist in various areas across North America.docxrtodd432
 
FInd and invertible matrix U so that UR - R is in Reduced Row echelon.docx
FInd and invertible matrix U so that UR - R is in Reduced Row echelon.docxFInd and invertible matrix U so that UR - R is in Reduced Row echelon.docx
FInd and invertible matrix U so that UR - R is in Reduced Row echelon.docxrtodd432
 
Financial intermediaries play a crucial role in an economic crisisthey.docx
Financial intermediaries play a crucial role in an economic crisisthey.docxFinancial intermediaries play a crucial role in an economic crisisthey.docx
Financial intermediaries play a crucial role in an economic crisisthey.docxrtodd432
 
Financial Institutions Describe each of the following financial instit.docx
Financial Institutions Describe each of the following financial instit.docxFinancial Institutions Describe each of the following financial instit.docx
Financial Institutions Describe each of the following financial instit.docxrtodd432
 
Financial ratio analysis is conducted by managers- equity investors- l.docx
Financial ratio analysis is conducted by managers- equity investors- l.docxFinancial ratio analysis is conducted by managers- equity investors- l.docx
Financial ratio analysis is conducted by managers- equity investors- l.docxrtodd432
 
Files are logical units of information created by processes- A disk ma.docx
Files are logical units of information created by processes- A disk ma.docxFiles are logical units of information created by processes- A disk ma.docx
Files are logical units of information created by processes- A disk ma.docxrtodd432
 
Fill in the blank Accurate determination of abundances of isotopes bec.docx
Fill in the blank Accurate determination of abundances of isotopes bec.docxFill in the blank Accurate determination of abundances of isotopes bec.docx
Fill in the blank Accurate determination of abundances of isotopes bec.docxrtodd432
 
Exercise 16-16 On January 1- 2012- Chang Corp- had 564-000 shares of c.docx
Exercise 16-16 On January 1- 2012- Chang Corp- had 564-000 shares of c.docxExercise 16-16 On January 1- 2012- Chang Corp- had 564-000 shares of c.docx
Exercise 16-16 On January 1- 2012- Chang Corp- had 564-000 shares of c.docxrtodd432
 
QUESTION 3 Associate each application with the type of transmisision-.docx
QUESTION 3 Associate each application with the type of transmisision-.docxQUESTION 3 Associate each application with the type of transmisision-.docx
QUESTION 3 Associate each application with the type of transmisision-.docxrtodd432
 

Plus de rtodd432 (20)

Explain the reasons why chloride ions (Cl-) is detrimental to corrosio.docx
Explain the reasons why chloride ions (Cl-) is detrimental to corrosio.docxExplain the reasons why chloride ions (Cl-) is detrimental to corrosio.docx
Explain the reasons why chloride ions (Cl-) is detrimental to corrosio.docx
 
Explain the purpose of a data member-SolutionAnswer Data Member It is.docx
Explain the purpose of a data member-SolutionAnswer Data Member It is.docxExplain the purpose of a data member-SolutionAnswer Data Member It is.docx
Explain the purpose of a data member-SolutionAnswer Data Member It is.docx
 
Explain the function of the following methods in LinkedList 1- addFirs.docx
Explain the function of the following methods in LinkedList 1- addFirs.docxExplain the function of the following methods in LinkedList 1- addFirs.docx
Explain the function of the following methods in LinkedList 1- addFirs.docx
 
Explain the motivation behind using a header file for a C program-Solu.docx
Explain the motivation behind using a header file for a C program-Solu.docxExplain the motivation behind using a header file for a C program-Solu.docx
Explain the motivation behind using a header file for a C program-Solu.docx
 
Explain the effect doping towards an intrinsic silicon- Give one examp.docx
Explain the effect doping towards an intrinsic silicon- Give one examp.docxExplain the effect doping towards an intrinsic silicon- Give one examp.docx
Explain the effect doping towards an intrinsic silicon- Give one examp.docx
 
Explain how goverment deficit lead to increases in the money supply-.docx
Explain how goverment deficit lead to increases in the money supply-.docxExplain how goverment deficit lead to increases in the money supply-.docx
Explain how goverment deficit lead to increases in the money supply-.docx
 
Explain how doping Si allows you to transport charges in a detector-So.docx
Explain how doping Si allows you to transport charges in a detector-So.docxExplain how doping Si allows you to transport charges in a detector-So.docx
Explain how doping Si allows you to transport charges in a detector-So.docx
 
Explain how an --interest group-- (or --special interest group--) may.docx
Explain how an --interest group-- (or --special interest group--) may.docxExplain how an --interest group-- (or --special interest group--) may.docx
Explain how an --interest group-- (or --special interest group--) may.docx
 
Explain how stock price volatility is more likely to imply risk than e.docx
Explain how stock price volatility is more likely to imply risk than e.docxExplain how stock price volatility is more likely to imply risk than e.docx
Explain how stock price volatility is more likely to imply risk than e.docx
 
Explain the concept entropy Explain the concept entropySolutionAnswe.docx
Explain the concept entropy   Explain the concept entropySolutionAnswe.docxExplain the concept entropy   Explain the concept entropySolutionAnswe.docx
Explain the concept entropy Explain the concept entropySolutionAnswe.docx
 
Explain how would you determine a covalent bond compounds bond using L.docx
Explain how would you determine a covalent bond compounds bond using L.docxExplain how would you determine a covalent bond compounds bond using L.docx
Explain how would you determine a covalent bond compounds bond using L.docx
 
Expansive (swelling) clays exist in various areas across North America.docx
Expansive (swelling) clays exist in various areas across North America.docxExpansive (swelling) clays exist in various areas across North America.docx
Expansive (swelling) clays exist in various areas across North America.docx
 
FInd and invertible matrix U so that UR - R is in Reduced Row echelon.docx
FInd and invertible matrix U so that UR - R is in Reduced Row echelon.docxFInd and invertible matrix U so that UR - R is in Reduced Row echelon.docx
FInd and invertible matrix U so that UR - R is in Reduced Row echelon.docx
 
Financial intermediaries play a crucial role in an economic crisisthey.docx
Financial intermediaries play a crucial role in an economic crisisthey.docxFinancial intermediaries play a crucial role in an economic crisisthey.docx
Financial intermediaries play a crucial role in an economic crisisthey.docx
 
Financial Institutions Describe each of the following financial instit.docx
Financial Institutions Describe each of the following financial instit.docxFinancial Institutions Describe each of the following financial instit.docx
Financial Institutions Describe each of the following financial instit.docx
 
Financial ratio analysis is conducted by managers- equity investors- l.docx
Financial ratio analysis is conducted by managers- equity investors- l.docxFinancial ratio analysis is conducted by managers- equity investors- l.docx
Financial ratio analysis is conducted by managers- equity investors- l.docx
 
Files are logical units of information created by processes- A disk ma.docx
Files are logical units of information created by processes- A disk ma.docxFiles are logical units of information created by processes- A disk ma.docx
Files are logical units of information created by processes- A disk ma.docx
 
Fill in the blank Accurate determination of abundances of isotopes bec.docx
Fill in the blank Accurate determination of abundances of isotopes bec.docxFill in the blank Accurate determination of abundances of isotopes bec.docx
Fill in the blank Accurate determination of abundances of isotopes bec.docx
 
Exercise 16-16 On January 1- 2012- Chang Corp- had 564-000 shares of c.docx
Exercise 16-16 On January 1- 2012- Chang Corp- had 564-000 shares of c.docxExercise 16-16 On January 1- 2012- Chang Corp- had 564-000 shares of c.docx
Exercise 16-16 On January 1- 2012- Chang Corp- had 564-000 shares of c.docx
 
QUESTION 3 Associate each application with the type of transmisision-.docx
QUESTION 3 Associate each application with the type of transmisision-.docxQUESTION 3 Associate each application with the type of transmisision-.docx
QUESTION 3 Associate each application with the type of transmisision-.docx
 

Dernier

FILIPINO PSYCHology sikolohiyang pilipino
FILIPINO PSYCHology sikolohiyang pilipinoFILIPINO PSYCHology sikolohiyang pilipino
FILIPINO PSYCHology sikolohiyang pilipinojohnmickonozaleda
 
ACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfSpandanaRallapalli
 
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTSGRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTSJoshuaGantuangco2
 
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYKayeClaireEstoconing
 
Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Celine George
 
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdfVirtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdfErwinPantujan2
 
Judging the Relevance and worth of ideas part 2.pptx
Judging the Relevance  and worth of ideas part 2.pptxJudging the Relevance  and worth of ideas part 2.pptx
Judging the Relevance and worth of ideas part 2.pptxSherlyMaeNeri
 
Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Mark Reed
 
Culture Uniformity or Diversity IN SOCIOLOGY.pptx
Culture Uniformity or Diversity IN SOCIOLOGY.pptxCulture Uniformity or Diversity IN SOCIOLOGY.pptx
Culture Uniformity or Diversity IN SOCIOLOGY.pptxPoojaSen20
 
Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Jisc
 
Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...Seán Kennedy
 
Karra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptxKarra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptxAshokKarra1
 
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfGrade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfJemuel Francisco
 
4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptxmary850239
 
How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17Celine George
 
Choosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for ParentsChoosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for Parentsnavabharathschool99
 
4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptxmary850239
 

Dernier (20)

FILIPINO PSYCHology sikolohiyang pilipino
FILIPINO PSYCHology sikolohiyang pilipinoFILIPINO PSYCHology sikolohiyang pilipino
FILIPINO PSYCHology sikolohiyang pilipino
 
ACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdf
 
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
 
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTSGRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
 
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
 
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptxYOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
 
Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17
 
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdfVirtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
 
Judging the Relevance and worth of ideas part 2.pptx
Judging the Relevance  and worth of ideas part 2.pptxJudging the Relevance  and worth of ideas part 2.pptx
Judging the Relevance and worth of ideas part 2.pptx
 
Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)
 
Culture Uniformity or Diversity IN SOCIOLOGY.pptx
Culture Uniformity or Diversity IN SOCIOLOGY.pptxCulture Uniformity or Diversity IN SOCIOLOGY.pptx
Culture Uniformity or Diversity IN SOCIOLOGY.pptx
 
Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...
 
YOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptx
YOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptxYOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptx
YOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptx
 
Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...
 
Karra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptxKarra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptx
 
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfGrade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
 
4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx
 
How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17
 
Choosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for ParentsChoosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for Parents
 
4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx
 

Difference between private and protected members in Java classes

  • 1. Explain the difference between private and proctected members of a class. Solution Hi, I am explaning difference between private and public in context of Java Programing Language(since you have not mentioned any Programing Language). private : Members marked private can not be accessed by code in any class other than the class in which the priavte member was declared. - A private member is invisible to any code outside the member's own class. - When a member(function) is declared private, a subclass can not inherit it. protected :Â Â Members marked protected can be accessed by a subclass(child class) even if the subclass is in a different package.