SlideShare a Scribd company logo
1 of 2
1. Are a private and a platoon in an encapsulation or an inheritence relationship? Explain
2. Present reasonable parent and child classes for the class Tree (the biological kind). Give a
short explanation for why the classes you are proposing are in good parent-child relationships.
Solution
1.Private members cannot be inherited directly. Inheritance is not possible through normal object
oriented programming methods. Private members are never accessible directly from any other
class. But there are methods to access private members through their public getter or setter
methods of the same class. So access to private members is possible through encapsulation via
public getter method.
2. Inheritance is a property of Object Oriented Programming that describes the relationship
among classes in a tree format. There are different types of inheritance like, single,
multiple,multilevel and derived. For all these derivations we need base class, parent class and
child class.
A base class is a class that is created with the intention of deriving other classes from it. A parent
class is the closest class that we derived from to create the one we are referencing as the child
class. A child class is a class that was derived from another, that will now be the parent class to
it.
It is best to think of the parent/child relationship in OOP as a concept of “inheritance―
rather than a concept of containers and contained elements. In OOP, a parent is one class, and a
child is another class that inherits all of the attributes and functions assigned to the parent class.
Setting parent-child relationships for classes ensures that the system can provide many types of
automatic behavior, such as:
1- Are a private and a platoon in an encapsulation or an inheritence r.docx

More Related Content

Similar to 1- Are a private and a platoon in an encapsulation or an inheritence r.docx

ECE 353 PAPERS Education for Service-- ece353papers.com
ECE 353 PAPERS Education for Service-- ece353papers.comECE 353 PAPERS Education for Service-- ece353papers.com
ECE 353 PAPERS Education for Service-- ece353papers.comabhila191
 
SAD02 - Object Orientation
SAD02 - Object OrientationSAD02 - Object Orientation
SAD02 - Object OrientationMichael Heron
 
Cooperative learning presentation
Cooperative learning presentationCooperative learning presentation
Cooperative learning presentationKen Gillam
 
Educational Social Software Edmedia 2007
Educational Social Software Edmedia 2007Educational Social Software Edmedia 2007
Educational Social Software Edmedia 2007Terry Anderson
 
My webquest abraham lincoln
My webquest abraham lincoln My webquest abraham lincoln
My webquest abraham lincoln BrianM1332
 
My Webquest Brian Mallon
My Webquest Brian MallonMy Webquest Brian Mallon
My Webquest Brian MallonBrianM1332
 
Human behavior in Organization
Human behavior in OrganizationHuman behavior in Organization
Human behavior in OrganizationJessica Gutierrez
 
Blooms-Taxonomy-of-Educational-Objectives-2.pptx
Blooms-Taxonomy-of-Educational-Objectives-2.pptxBlooms-Taxonomy-of-Educational-Objectives-2.pptx
Blooms-Taxonomy-of-Educational-Objectives-2.pptxRoseMarieJaromayOder
 
Inheritance and Substitution
Inheritance and SubstitutionInheritance and Substitution
Inheritance and Substitutionadil raja
 
EL PAPEL DE FORMADOR - DINAMIZADOR EN EL CENTRO GUADALINFO
EL PAPEL DE FORMADOR - DINAMIZADOR EN EL CENTRO GUADALINFOEL PAPEL DE FORMADOR - DINAMIZADOR EN EL CENTRO GUADALINFO
EL PAPEL DE FORMADOR - DINAMIZADOR EN EL CENTRO GUADALINFOFelisa Sanchez Molina
 
Jennifer Class Newsletter
Jennifer Class NewsletterJennifer Class Newsletter
Jennifer Class NewsletterJenniferDShaw
 
Newsletter
NewsletterNewsletter
NewsletterGroup1
 
summative notesAssessment and Grading in the Differentiated C.docx
summative notesAssessment and Grading in the Differentiated C.docxsummative notesAssessment and Grading in the Differentiated C.docx
summative notesAssessment and Grading in the Differentiated C.docxdeanmtaylor1545
 
Inheritance and its necessity in java.ppt
Inheritance and its necessity in java.pptInheritance and its necessity in java.ppt
Inheritance and its necessity in java.pptssuserf170c4
 
Differentiating features of gifted children and dealing with high IQ societies
Differentiating features of gifted children and dealing with high IQ societiesDifferentiating features of gifted children and dealing with high IQ societies
Differentiating features of gifted children and dealing with high IQ societiesMarco Ripà
 
ECE 353 PAPERS Inspiring Innovation--ece353papers.com
ECE 353 PAPERS Inspiring Innovation--ece353papers.comECE 353 PAPERS Inspiring Innovation--ece353papers.com
ECE 353 PAPERS Inspiring Innovation--ece353papers.comsachin10205
 
PerDev_Q2_Module-9_FamilyStructuresAndLegacies_VER2.docx
PerDev_Q2_Module-9_FamilyStructuresAndLegacies_VER2.docxPerDev_Q2_Module-9_FamilyStructuresAndLegacies_VER2.docx
PerDev_Q2_Module-9_FamilyStructuresAndLegacies_VER2.docxROSEYEE4
 
Conceptual Change - Unlearn to Relearn
Conceptual Change - Unlearn to RelearnConceptual Change - Unlearn to Relearn
Conceptual Change - Unlearn to RelearnJennifer S. Groff
 

Similar to 1- Are a private and a platoon in an encapsulation or an inheritence r.docx (20)

ECE 353 PAPERS Education for Service-- ece353papers.com
ECE 353 PAPERS Education for Service-- ece353papers.comECE 353 PAPERS Education for Service-- ece353papers.com
ECE 353 PAPERS Education for Service-- ece353papers.com
 
Webquest
WebquestWebquest
Webquest
 
SAD02 - Object Orientation
SAD02 - Object OrientationSAD02 - Object Orientation
SAD02 - Object Orientation
 
Cooperative learning presentation
Cooperative learning presentationCooperative learning presentation
Cooperative learning presentation
 
Concept Map 3
Concept Map 3Concept Map 3
Concept Map 3
 
Educational Social Software Edmedia 2007
Educational Social Software Edmedia 2007Educational Social Software Edmedia 2007
Educational Social Software Edmedia 2007
 
My webquest abraham lincoln
My webquest abraham lincoln My webquest abraham lincoln
My webquest abraham lincoln
 
My Webquest Brian Mallon
My Webquest Brian MallonMy Webquest Brian Mallon
My Webquest Brian Mallon
 
Human behavior in Organization
Human behavior in OrganizationHuman behavior in Organization
Human behavior in Organization
 
Blooms-Taxonomy-of-Educational-Objectives-2.pptx
Blooms-Taxonomy-of-Educational-Objectives-2.pptxBlooms-Taxonomy-of-Educational-Objectives-2.pptx
Blooms-Taxonomy-of-Educational-Objectives-2.pptx
 
Inheritance and Substitution
Inheritance and SubstitutionInheritance and Substitution
Inheritance and Substitution
 
EL PAPEL DE FORMADOR - DINAMIZADOR EN EL CENTRO GUADALINFO
EL PAPEL DE FORMADOR - DINAMIZADOR EN EL CENTRO GUADALINFOEL PAPEL DE FORMADOR - DINAMIZADOR EN EL CENTRO GUADALINFO
EL PAPEL DE FORMADOR - DINAMIZADOR EN EL CENTRO GUADALINFO
 
Jennifer Class Newsletter
Jennifer Class NewsletterJennifer Class Newsletter
Jennifer Class Newsletter
 
Newsletter
NewsletterNewsletter
Newsletter
 
summative notesAssessment and Grading in the Differentiated C.docx
summative notesAssessment and Grading in the Differentiated C.docxsummative notesAssessment and Grading in the Differentiated C.docx
summative notesAssessment and Grading in the Differentiated C.docx
 
Inheritance and its necessity in java.ppt
Inheritance and its necessity in java.pptInheritance and its necessity in java.ppt
Inheritance and its necessity in java.ppt
 
Differentiating features of gifted children and dealing with high IQ societies
Differentiating features of gifted children and dealing with high IQ societiesDifferentiating features of gifted children and dealing with high IQ societies
Differentiating features of gifted children and dealing with high IQ societies
 
ECE 353 PAPERS Inspiring Innovation--ece353papers.com
ECE 353 PAPERS Inspiring Innovation--ece353papers.comECE 353 PAPERS Inspiring Innovation--ece353papers.com
ECE 353 PAPERS Inspiring Innovation--ece353papers.com
 
PerDev_Q2_Module-9_FamilyStructuresAndLegacies_VER2.docx
PerDev_Q2_Module-9_FamilyStructuresAndLegacies_VER2.docxPerDev_Q2_Module-9_FamilyStructuresAndLegacies_VER2.docx
PerDev_Q2_Module-9_FamilyStructuresAndLegacies_VER2.docx
 
Conceptual Change - Unlearn to Relearn
Conceptual Change - Unlearn to RelearnConceptual Change - Unlearn to Relearn
Conceptual Change - Unlearn to Relearn
 

More from tpaula2

How can I calculate the missing amounts for each of the independent ca.docx
How can I calculate the missing amounts for each of the independent ca.docxHow can I calculate the missing amounts for each of the independent ca.docx
How can I calculate the missing amounts for each of the independent ca.docxtpaula2
 
How can other countries respond to international piracy-Solutiona-) St.docx
How can other countries respond to international piracy-Solutiona-) St.docxHow can other countries respond to international piracy-Solutiona-) St.docx
How can other countries respond to international piracy-Solutiona-) St.docxtpaula2
 
How do I block a certain range of IP addresses in a CENTOS server from.docx
How do I block a certain range of IP addresses in a CENTOS server from.docxHow do I block a certain range of IP addresses in a CENTOS server from.docx
How do I block a certain range of IP addresses in a CENTOS server from.docxtpaula2
 
How can we reduce software requirement errors -SolutionIf we want to r.docx
How can we reduce software requirement errors -SolutionIf we want to r.docxHow can we reduce software requirement errors -SolutionIf we want to r.docx
How can we reduce software requirement errors -SolutionIf we want to r.docxtpaula2
 
How do arrays compare with variables and how do they differ- Give a si.docx
How do arrays compare with variables and how do they differ- Give a si.docxHow do arrays compare with variables and how do they differ- Give a si.docx
How do arrays compare with variables and how do they differ- Give a si.docxtpaula2
 
How can the use of Internet search engines to locate information about.docx
How can the use of Internet search engines to locate information about.docxHow can the use of Internet search engines to locate information about.docx
How can the use of Internet search engines to locate information about.docxtpaula2
 
How change in a corporation-'s natural and societal environments can a.docx
How change in a corporation-'s natural and societal environments can a.docxHow change in a corporation-'s natural and societal environments can a.docx
How change in a corporation-'s natural and societal environments can a.docxtpaula2
 
How can you prevent intruders from accessing your wireless network- a).docx
How can you prevent intruders from accessing your wireless network- a).docxHow can you prevent intruders from accessing your wireless network- a).docx
How can you prevent intruders from accessing your wireless network- a).docxtpaula2
 
How are standing waves similar to beats and how are they different- Ty.docx
How are standing waves similar to beats and how are they different- Ty.docxHow are standing waves similar to beats and how are they different- Ty.docx
How are standing waves similar to beats and how are they different- Ty.docxtpaula2
 
How are corporate abuse of power corporate fraud- and corporate econom.docx
How are corporate abuse of power corporate fraud- and corporate econom.docxHow are corporate abuse of power corporate fraud- and corporate econom.docx
How are corporate abuse of power corporate fraud- and corporate econom.docxtpaula2
 
How can biometric technology be used to fight cybercrime and cyber rel.docx
How can biometric technology be used to fight cybercrime and cyber rel.docxHow can biometric technology be used to fight cybercrime and cyber rel.docx
How can biometric technology be used to fight cybercrime and cyber rel.docxtpaula2
 
Holmes- CPA- assisted Williams Corporation in preparing its financial.docx
Holmes- CPA- assisted Williams Corporation in preparing its financial.docxHolmes- CPA- assisted Williams Corporation in preparing its financial.docx
Holmes- CPA- assisted Williams Corporation in preparing its financial.docxtpaula2
 
HNO2 has a Ka of 4-00x10^-3- What is the pH of a solution prepared by.docx
HNO2 has a Ka of 4-00x10^-3- What is the pH of a solution prepared by.docxHNO2 has a Ka of 4-00x10^-3- What is the pH of a solution prepared by.docx
HNO2 has a Ka of 4-00x10^-3- What is the pH of a solution prepared by.docxtpaula2
 
Hi- Can you answer this question- Please show all your work and show i.docx
Hi- Can you answer this question- Please show all your work and show i.docxHi- Can you answer this question- Please show all your work and show i.docx
Hi- Can you answer this question- Please show all your work and show i.docxtpaula2
 
Hi! I think the answer is C Outsource the software- I juyst wanted to.docx
Hi! I think the answer is C Outsource the software- I juyst wanted to.docxHi! I think the answer is C Outsource the software- I juyst wanted to.docx
Hi! I think the answer is C Outsource the software- I juyst wanted to.docxtpaula2
 
Hi all! someone help me pls Fraud examination I need to write an essay.docx
Hi all! someone help me pls Fraud examination I need to write an essay.docxHi all! someone help me pls Fraud examination I need to write an essay.docx
Hi all! someone help me pls Fraud examination I need to write an essay.docxtpaula2
 
Herbie Corp-'s Balance Sheet showed the following at 12-31-13 Common S.docx
Herbie Corp-'s Balance Sheet showed the following at 12-31-13 Common S.docxHerbie Corp-'s Balance Sheet showed the following at 12-31-13 Common S.docx
Herbie Corp-'s Balance Sheet showed the following at 12-31-13 Common S.docxtpaula2
 
Here is a list of the main characters in Shakespeare-'s Romeo and Juli.docx
Here is a list of the main characters in Shakespeare-'s Romeo and Juli.docxHere is a list of the main characters in Shakespeare-'s Romeo and Juli.docx
Here is a list of the main characters in Shakespeare-'s Romeo and Juli.docxtpaula2
 
1- How many ATOMS of sulfur are present in 2-25 moles of sulfur trioxi.docx
1- How many ATOMS of sulfur are present in 2-25 moles of sulfur trioxi.docx1- How many ATOMS of sulfur are present in 2-25 moles of sulfur trioxi.docx
1- How many ATOMS of sulfur are present in 2-25 moles of sulfur trioxi.docxtpaula2
 
1- How does having a scope and WBS help project teams during project e.docx
1- How does having a scope and WBS help project teams during project e.docx1- How does having a scope and WBS help project teams during project e.docx
1- How does having a scope and WBS help project teams during project e.docxtpaula2
 

More from tpaula2 (20)

How can I calculate the missing amounts for each of the independent ca.docx
How can I calculate the missing amounts for each of the independent ca.docxHow can I calculate the missing amounts for each of the independent ca.docx
How can I calculate the missing amounts for each of the independent ca.docx
 
How can other countries respond to international piracy-Solutiona-) St.docx
How can other countries respond to international piracy-Solutiona-) St.docxHow can other countries respond to international piracy-Solutiona-) St.docx
How can other countries respond to international piracy-Solutiona-) St.docx
 
How do I block a certain range of IP addresses in a CENTOS server from.docx
How do I block a certain range of IP addresses in a CENTOS server from.docxHow do I block a certain range of IP addresses in a CENTOS server from.docx
How do I block a certain range of IP addresses in a CENTOS server from.docx
 
How can we reduce software requirement errors -SolutionIf we want to r.docx
How can we reduce software requirement errors -SolutionIf we want to r.docxHow can we reduce software requirement errors -SolutionIf we want to r.docx
How can we reduce software requirement errors -SolutionIf we want to r.docx
 
How do arrays compare with variables and how do they differ- Give a si.docx
How do arrays compare with variables and how do they differ- Give a si.docxHow do arrays compare with variables and how do they differ- Give a si.docx
How do arrays compare with variables and how do they differ- Give a si.docx
 
How can the use of Internet search engines to locate information about.docx
How can the use of Internet search engines to locate information about.docxHow can the use of Internet search engines to locate information about.docx
How can the use of Internet search engines to locate information about.docx
 
How change in a corporation-'s natural and societal environments can a.docx
How change in a corporation-'s natural and societal environments can a.docxHow change in a corporation-'s natural and societal environments can a.docx
How change in a corporation-'s natural and societal environments can a.docx
 
How can you prevent intruders from accessing your wireless network- a).docx
How can you prevent intruders from accessing your wireless network- a).docxHow can you prevent intruders from accessing your wireless network- a).docx
How can you prevent intruders from accessing your wireless network- a).docx
 
How are standing waves similar to beats and how are they different- Ty.docx
How are standing waves similar to beats and how are they different- Ty.docxHow are standing waves similar to beats and how are they different- Ty.docx
How are standing waves similar to beats and how are they different- Ty.docx
 
How are corporate abuse of power corporate fraud- and corporate econom.docx
How are corporate abuse of power corporate fraud- and corporate econom.docxHow are corporate abuse of power corporate fraud- and corporate econom.docx
How are corporate abuse of power corporate fraud- and corporate econom.docx
 
How can biometric technology be used to fight cybercrime and cyber rel.docx
How can biometric technology be used to fight cybercrime and cyber rel.docxHow can biometric technology be used to fight cybercrime and cyber rel.docx
How can biometric technology be used to fight cybercrime and cyber rel.docx
 
Holmes- CPA- assisted Williams Corporation in preparing its financial.docx
Holmes- CPA- assisted Williams Corporation in preparing its financial.docxHolmes- CPA- assisted Williams Corporation in preparing its financial.docx
Holmes- CPA- assisted Williams Corporation in preparing its financial.docx
 
HNO2 has a Ka of 4-00x10^-3- What is the pH of a solution prepared by.docx
HNO2 has a Ka of 4-00x10^-3- What is the pH of a solution prepared by.docxHNO2 has a Ka of 4-00x10^-3- What is the pH of a solution prepared by.docx
HNO2 has a Ka of 4-00x10^-3- What is the pH of a solution prepared by.docx
 
Hi- Can you answer this question- Please show all your work and show i.docx
Hi- Can you answer this question- Please show all your work and show i.docxHi- Can you answer this question- Please show all your work and show i.docx
Hi- Can you answer this question- Please show all your work and show i.docx
 
Hi! I think the answer is C Outsource the software- I juyst wanted to.docx
Hi! I think the answer is C Outsource the software- I juyst wanted to.docxHi! I think the answer is C Outsource the software- I juyst wanted to.docx
Hi! I think the answer is C Outsource the software- I juyst wanted to.docx
 
Hi all! someone help me pls Fraud examination I need to write an essay.docx
Hi all! someone help me pls Fraud examination I need to write an essay.docxHi all! someone help me pls Fraud examination I need to write an essay.docx
Hi all! someone help me pls Fraud examination I need to write an essay.docx
 
Herbie Corp-'s Balance Sheet showed the following at 12-31-13 Common S.docx
Herbie Corp-'s Balance Sheet showed the following at 12-31-13 Common S.docxHerbie Corp-'s Balance Sheet showed the following at 12-31-13 Common S.docx
Herbie Corp-'s Balance Sheet showed the following at 12-31-13 Common S.docx
 
Here is a list of the main characters in Shakespeare-'s Romeo and Juli.docx
Here is a list of the main characters in Shakespeare-'s Romeo and Juli.docxHere is a list of the main characters in Shakespeare-'s Romeo and Juli.docx
Here is a list of the main characters in Shakespeare-'s Romeo and Juli.docx
 
1- How many ATOMS of sulfur are present in 2-25 moles of sulfur trioxi.docx
1- How many ATOMS of sulfur are present in 2-25 moles of sulfur trioxi.docx1- How many ATOMS of sulfur are present in 2-25 moles of sulfur trioxi.docx
1- How many ATOMS of sulfur are present in 2-25 moles of sulfur trioxi.docx
 
1- How does having a scope and WBS help project teams during project e.docx
1- How does having a scope and WBS help project teams during project e.docx1- How does having a scope and WBS help project teams during project e.docx
1- How does having a scope and WBS help project teams during project e.docx
 

Recently uploaded

HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxEsquimalt MFRC
 
21st_Century_Skills_Framework_Final_Presentation_2.pptx
21st_Century_Skills_Framework_Final_Presentation_2.pptx21st_Century_Skills_Framework_Final_Presentation_2.pptx
21st_Century_Skills_Framework_Final_Presentation_2.pptxJoelynRubio1
 
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...Amil baba
 
OSCM Unit 2_Operations Processes & Systems
OSCM Unit 2_Operations Processes & SystemsOSCM Unit 2_Operations Processes & Systems
OSCM Unit 2_Operations Processes & SystemsSandeep D Chaudhary
 
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfUnit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfDr Vijay Vishwakarma
 
How to Manage Call for Tendor in Odoo 17
How to Manage Call for Tendor in Odoo 17How to Manage Call for Tendor in Odoo 17
How to Manage Call for Tendor in Odoo 17Celine George
 
What is 3 Way Matching Process in Odoo 17.pptx
What is 3 Way Matching Process in Odoo 17.pptxWhat is 3 Way Matching Process in Odoo 17.pptx
What is 3 Way Matching Process in Odoo 17.pptxCeline George
 
Simple, Complex, and Compound Sentences Exercises.pdf
Simple, Complex, and Compound Sentences Exercises.pdfSimple, Complex, and Compound Sentences Exercises.pdf
Simple, Complex, and Compound Sentences Exercises.pdfstareducators107
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and ModificationsMJDuyan
 
Tatlong Kwento ni Lola basyang-1.pdf arts
Tatlong Kwento ni Lola basyang-1.pdf artsTatlong Kwento ni Lola basyang-1.pdf arts
Tatlong Kwento ni Lola basyang-1.pdf artsNbelano25
 
Wellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxWellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxJisc
 
Introduction to TechSoup’s Digital Marketing Services and Use Cases
Introduction to TechSoup’s Digital Marketing  Services and Use CasesIntroduction to TechSoup’s Digital Marketing  Services and Use Cases
Introduction to TechSoup’s Digital Marketing Services and Use CasesTechSoup
 
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...EADTU
 
Personalisation of Education by AI and Big Data - Lourdes Guàrdia
Personalisation of Education by AI and Big Data - Lourdes GuàrdiaPersonalisation of Education by AI and Big Data - Lourdes Guàrdia
Personalisation of Education by AI and Big Data - Lourdes GuàrdiaEADTU
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxJisc
 
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxHMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxmarlenawright1
 
PANDITA RAMABAI- Indian political thought GENDER.pptx
PANDITA RAMABAI- Indian political thought GENDER.pptxPANDITA RAMABAI- Indian political thought GENDER.pptx
PANDITA RAMABAI- Indian political thought GENDER.pptxakanksha16arora
 

Recently uploaded (20)

HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
 
21st_Century_Skills_Framework_Final_Presentation_2.pptx
21st_Century_Skills_Framework_Final_Presentation_2.pptx21st_Century_Skills_Framework_Final_Presentation_2.pptx
21st_Century_Skills_Framework_Final_Presentation_2.pptx
 
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
 
OSCM Unit 2_Operations Processes & Systems
OSCM Unit 2_Operations Processes & SystemsOSCM Unit 2_Operations Processes & Systems
OSCM Unit 2_Operations Processes & Systems
 
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfUnit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
 
How to Manage Call for Tendor in Odoo 17
How to Manage Call for Tendor in Odoo 17How to Manage Call for Tendor in Odoo 17
How to Manage Call for Tendor in Odoo 17
 
What is 3 Way Matching Process in Odoo 17.pptx
What is 3 Way Matching Process in Odoo 17.pptxWhat is 3 Way Matching Process in Odoo 17.pptx
What is 3 Way Matching Process in Odoo 17.pptx
 
VAMOS CUIDAR DO NOSSO PLANETA! .
VAMOS CUIDAR DO NOSSO PLANETA!                    .VAMOS CUIDAR DO NOSSO PLANETA!                    .
VAMOS CUIDAR DO NOSSO PLANETA! .
 
Simple, Complex, and Compound Sentences Exercises.pdf
Simple, Complex, and Compound Sentences Exercises.pdfSimple, Complex, and Compound Sentences Exercises.pdf
Simple, Complex, and Compound Sentences Exercises.pdf
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
 
Tatlong Kwento ni Lola basyang-1.pdf arts
Tatlong Kwento ni Lola basyang-1.pdf artsTatlong Kwento ni Lola basyang-1.pdf arts
Tatlong Kwento ni Lola basyang-1.pdf arts
 
Wellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxWellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptx
 
Introduction to TechSoup’s Digital Marketing Services and Use Cases
Introduction to TechSoup’s Digital Marketing  Services and Use CasesIntroduction to TechSoup’s Digital Marketing  Services and Use Cases
Introduction to TechSoup’s Digital Marketing Services and Use Cases
 
Including Mental Health Support in Project Delivery, 14 May.pdf
Including Mental Health Support in Project Delivery, 14 May.pdfIncluding Mental Health Support in Project Delivery, 14 May.pdf
Including Mental Health Support in Project Delivery, 14 May.pdf
 
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
 
Personalisation of Education by AI and Big Data - Lourdes Guàrdia
Personalisation of Education by AI and Big Data - Lourdes GuàrdiaPersonalisation of Education by AI and Big Data - Lourdes Guàrdia
Personalisation of Education by AI and Big Data - Lourdes Guàrdia
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptx
 
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxHMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
 
OS-operating systems- ch05 (CPU Scheduling) ...
OS-operating systems- ch05 (CPU Scheduling) ...OS-operating systems- ch05 (CPU Scheduling) ...
OS-operating systems- ch05 (CPU Scheduling) ...
 
PANDITA RAMABAI- Indian political thought GENDER.pptx
PANDITA RAMABAI- Indian political thought GENDER.pptxPANDITA RAMABAI- Indian political thought GENDER.pptx
PANDITA RAMABAI- Indian political thought GENDER.pptx
 

1- Are a private and a platoon in an encapsulation or an inheritence r.docx

  • 1. 1. Are a private and a platoon in an encapsulation or an inheritence relationship? Explain 2. Present reasonable parent and child classes for the class Tree (the biological kind). Give a short explanation for why the classes you are proposing are in good parent-child relationships. Solution 1.Private members cannot be inherited directly. Inheritance is not possible through normal object oriented programming methods. Private members are never accessible directly from any other class. But there are methods to access private members through their public getter or setter methods of the same class. So access to private members is possible through encapsulation via public getter method. 2. Inheritance is a property of Object Oriented Programming that describes the relationship among classes in a tree format. There are different types of inheritance like, single, multiple,multilevel and derived. For all these derivations we need base class, parent class and child class. A base class is a class that is created with the intention of deriving other classes from it. A parent class is the closest class that we derived from to create the one we are referencing as the child class. A child class is a class that was derived from another, that will now be the parent class to it. It is best to think of the parent/child relationship in OOP as a concept of “inheritance― rather than a concept of containers and contained elements. In OOP, a parent is one class, and a child is another class that inherits all of the attributes and functions assigned to the parent class. Setting parent-child relationships for classes ensures that the system can provide many types of automatic behavior, such as: