SlideShare una empresa de Scribd logo
1 de 41
Chapter 7:  Inheritance  Presentation slides for Java Software Solutions for AP* Computer Science by John Lewis, William Loftus, and Cara Cocking Java Software Solutions is published by Addison-Wesley Presentation slides are copyright 200s by John Lewis, William Loftus, and Cara Cocking. All rights reserved. Instructors using the textbook may use and modify these slides for pedagogical purposes. *AP is a registered trademark of The College Entrance Examination Board which was not involved in the production of, and does not endorse, this product.
Inheritance ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Inheritance ,[object Object],[object Object],[object Object],[object Object],[object Object]
Inheritance ,[object Object],[object Object],[object Object]
Inheritance ,[object Object],Inheritance should create an  is-a relationship , meaning the child  is a  more specific version of the parent Vehicle Car
Deriving Subclasses ,[object Object],[object Object],[object Object],[object Object],class Car extends Vehicle {   // class contents }
Visibility Modifiers ,[object Object],[object Object],[object Object]
The super Reference ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
The super Reference ,[object Object],[object Object],[object Object]
Multiple Inheritance ,[object Object],[object Object],[object Object],[object Object],[object Object]
Overriding Methods ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Overloading vs. Overriding ,[object Object],[object Object],[object Object],[object Object],[object Object]
Class Hierarchies ,[object Object],Business KMart Macys ServiceBusiness Kinkos Retail Business
Class Hierarchies ,[object Object],[object Object],[object Object],[object Object],[object Object]
The Object Class ,[object Object],[object Object],[object Object],[object Object]
The Object Class ,[object Object],[object Object],[object Object],[object Object]
The Object Class ,[object Object],[object Object],[object Object],[object Object],[object Object]
The Object Class ,[object Object],[object Object],[object Object],[object Object]
Abstract Classes ,[object Object],[object Object],[object Object],public abstract class Whatever { // contents }
Abstract Classes ,[object Object],[object Object],[object Object],[object Object]
Abstract Classes ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Indirect Use of Members ,[object Object],[object Object],[object Object],[object Object],[object Object]
Polymorphism ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
References and Inheritance ,[object Object],[object Object],Holiday day; day = new Christmas(); Holiday Christmas
References and Inheritance ,[object Object],[object Object],[object Object],[object Object],[object Object]
Polymorphism via Inheritance ,[object Object],[object Object],[object Object],[object Object],[object Object]
Polymorphism via Inheritance ,[object Object],StaffMember Executive Hourly Volunteer Employee
Polymorphism via Inheritance ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Polymorphism via Interfaces ,[object Object],[object Object],[object Object],[object Object],[object Object]
Inheritance and GUIs ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Inheritance and GUIs ,[object Object],[object Object]
The Component Class Hierarchy ,[object Object],[object Object],[object Object]
Mouse Events ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Mouse Events ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
The Dots Program
Mouse Events ,[object Object],[object Object],[object Object],[object Object]
The RubberLines Program
Event Adapter Classes ,[object Object],[object Object],[object Object],[object Object]
Event Adapter Classes ,[object Object],[object Object],[object Object],[object Object]
The OffCenter Program
Summary ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]

Más contenido relacionado

La actualidad más candente

Ap Power Point Chpt3 B
Ap Power Point Chpt3 BAp Power Point Chpt3 B
Ap Power Point Chpt3 B
dplunkett
 
Object oriented basics
Object oriented basicsObject oriented basics
Object oriented basics
vamshimahi
 

La actualidad más candente (20)

OCA Java SE 8 Exam Chapter 2 Operators & Statements
OCA Java SE 8 Exam Chapter 2 Operators & StatementsOCA Java SE 8 Exam Chapter 2 Operators & Statements
OCA Java SE 8 Exam Chapter 2 Operators & Statements
 
Generics
GenericsGenerics
Generics
 
Ap Power Point Chpt3 B
Ap Power Point Chpt3 BAp Power Point Chpt3 B
Ap Power Point Chpt3 B
 
C++ Object oriented concepts & programming
C++ Object oriented concepts & programmingC++ Object oriented concepts & programming
C++ Object oriented concepts & programming
 
Generics in java
Generics in javaGenerics in java
Generics in java
 
OCA Java SE 8 Exam Chapter 1 Java Building Blocks
OCA Java SE 8 Exam Chapter 1 Java Building BlocksOCA Java SE 8 Exam Chapter 1 Java Building Blocks
OCA Java SE 8 Exam Chapter 1 Java Building Blocks
 
Java se 8 fundamentals
Java se 8 fundamentalsJava se 8 fundamentals
Java se 8 fundamentals
 
Java Interview Questions For Freshers
Java Interview Questions For FreshersJava Interview Questions For Freshers
Java Interview Questions For Freshers
 
Unit 1 Java
Unit 1 JavaUnit 1 Java
Unit 1 Java
 
SQL Interview Questions For Experienced
SQL Interview Questions For ExperiencedSQL Interview Questions For Experienced
SQL Interview Questions For Experienced
 
Classes objects in java
Classes objects in javaClasses objects in java
Classes objects in java
 
C# interview
C# interviewC# interview
C# interview
 
Java Programming Paradigms Chapter 1
Java Programming Paradigms Chapter 1 Java Programming Paradigms Chapter 1
Java Programming Paradigms Chapter 1
 
Chapter 7 - Defining Your Own Classes - Part II
Chapter 7 - Defining Your Own Classes - Part IIChapter 7 - Defining Your Own Classes - Part II
Chapter 7 - Defining Your Own Classes - Part II
 
Effective Java - Chapter 3: Methods Common to All Objects
Effective Java - Chapter 3: Methods Common to All ObjectsEffective Java - Chapter 3: Methods Common to All Objects
Effective Java - Chapter 3: Methods Common to All Objects
 
Object Oriented Programming In .Net
Object Oriented Programming In .NetObject Oriented Programming In .Net
Object Oriented Programming In .Net
 
Java basics and java variables
Java basics and java variablesJava basics and java variables
Java basics and java variables
 
Object oriented basics
Object oriented basicsObject oriented basics
Object oriented basics
 
Vb ch 3-object-oriented_fundamentals_in_vb.net
Vb ch 3-object-oriented_fundamentals_in_vb.netVb ch 3-object-oriented_fundamentals_in_vb.net
Vb ch 3-object-oriented_fundamentals_in_vb.net
 
My c++
My c++My c++
My c++
 

Destacado (7)

Lecture 4 recursion
Lecture 4    recursionLecture 4    recursion
Lecture 4 recursion
 
First Principles Of Cs Instruction
First Principles Of Cs InstructionFirst Principles Of Cs Instruction
First Principles Of Cs Instruction
 
Ap Power Point Chpt9
Ap Power Point Chpt9Ap Power Point Chpt9
Ap Power Point Chpt9
 
JavaYDL20
JavaYDL20JavaYDL20
JavaYDL20
 
Recursion Lecture in Java
Recursion Lecture in JavaRecursion Lecture in Java
Recursion Lecture in Java
 
Ap Power Point Chpt1
Ap Power Point Chpt1Ap Power Point Chpt1
Ap Power Point Chpt1
 
Internet principles of operation
Internet principles of operationInternet principles of operation
Internet principles of operation
 

Similar a Ap Power Point Chpt7

9781439035665 ppt ch10
9781439035665 ppt ch109781439035665 ppt ch10
9781439035665 ppt ch10
Terry Yoast
 

Similar a Ap Power Point Chpt7 (20)

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
 
Inheritance in java
Inheritance in javaInheritance in java
Inheritance in java
 
Unit 3 Java
Unit 3 JavaUnit 3 Java
Unit 3 Java
 
Chapter 8 java
Chapter 8 javaChapter 8 java
Chapter 8 java
 
Dr. Rajeshree Khande : Java Inheritance
Dr. Rajeshree Khande : Java InheritanceDr. Rajeshree Khande : Java Inheritance
Dr. Rajeshree Khande : Java Inheritance
 
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
 
OCA Java SE 8 Exam Chapter 5 Class Design
OCA Java SE 8 Exam Chapter 5 Class DesignOCA Java SE 8 Exam Chapter 5 Class Design
OCA Java SE 8 Exam Chapter 5 Class Design
 
4th_class.pdf
4th_class.pdf4th_class.pdf
4th_class.pdf
 
Java programming -Object-Oriented Thinking- Inheritance
Java programming -Object-Oriented Thinking- InheritanceJava programming -Object-Oriented Thinking- Inheritance
Java programming -Object-Oriented Thinking- Inheritance
 
Chap11
Chap11Chap11
Chap11
 
Chapter08 - Inheritance.ppt
Chapter08 - Inheritance.pptChapter08 - Inheritance.ppt
Chapter08 - Inheritance.ppt
 
JAVA-PPT'S.pdf
JAVA-PPT'S.pdfJAVA-PPT'S.pdf
JAVA-PPT'S.pdf
 
Java ppt
Java pptJava ppt
Java ppt
 
9781439035665 ppt ch10
9781439035665 ppt ch109781439035665 ppt ch10
9781439035665 ppt ch10
 
Introduction to Inheritance in Java for presentation
Introduction to Inheritance in Java for presentationIntroduction to Inheritance in Java for presentation
Introduction to Inheritance in Java for presentation
 

Último

Último (20)

Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 

Ap Power Point Chpt7

  • 1. Chapter 7: Inheritance Presentation slides for Java Software Solutions for AP* Computer Science by John Lewis, William Loftus, and Cara Cocking Java Software Solutions is published by Addison-Wesley Presentation slides are copyright 200s by John Lewis, William Loftus, and Cara Cocking. All rights reserved. Instructors using the textbook may use and modify these slides for pedagogical purposes. *AP is a registered trademark of The College Entrance Examination Board which was not involved in the production of, and does not endorse, this product.
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.
  • 14.
  • 15.
  • 16.
  • 17.
  • 18.
  • 19.
  • 20.
  • 21.
  • 22.
  • 23.
  • 24.
  • 25.
  • 26.
  • 27.
  • 28.
  • 29.
  • 30.
  • 31.
  • 32.
  • 33.
  • 34.
  • 36.
  • 38.
  • 39.
  • 41.