Aalborg Media Lab 19-Jun-15 Exercises/Summary Lecture 12 Summary, Exercises.

Slides:



Advertisements
Similar presentations
Inheritance. Many objects have a hierarchical relationship –Examples: zoo, car/vehicle, card game, airline reservation system Inheritance allows software.
Advertisements

Aalborg Media Lab 2-May-15 Exercises/Summary Lecture 10 Summary, Exercises.
1 Chapter 6: Extending classes and Inheritance. 2 Basics of Inheritance One of the basic objectives of Inheritance is code reuse If you want to extend.
Chapter 8 Inheritance. © 2004 Pearson Addison-Wesley. All rights reserved8-2 Inheritance Inheritance is a fundamental object-oriented design technique.
Chapter 7 Testing Class Hierarchies. SWE 415 Chapter 7 2 Reading Assignment  John McGregor and David A. Sykes, A Practical Guide to Testing Object-Oriented.
CS 211 Inheritance AAA.
Chapter 8 Inheritance 5 TH EDITION Lewis & Loftus java Software Solutions Foundations of Program Design © 2007 Pearson Addison-Wesley. All rights reserved.
Chapter 8 Inheritance Part 2. © 2004 Pearson Addison-Wesley. All rights reserved8-2 Outline Creating Subclasses Overriding Methods Class Hierarchies Inheritance.
Inheritance Inheritance Reserved word protected Reserved word super
Inheritance Polymorphism Briana B. Morrison CSE 1302C Spring 2010.
1 Inheritance Reserved word protected Reserved word super Overriding methods Class Hierarchies Reading for this lecture: L&L 8.1 – 8.5.
INF 523Q Chapter 7: Inheritance. 2 Inheritance  Another fundamental object-oriented technique is called inheritance, which enhances software design and.
Slides prepared by Rose Williams, Binghamton University Chapter 7 Inheritance.
1 Software Testing and Quality Assurance Lecture 28 – Testing Class Hierarchies.
Aalborg Media Lab 21-Jun-15 Software Design Lecture 1 “ Introduction to Java and OOP”
1 Inheritance and Polymorphism Inheritance (Continued) Polymorphism Polymorphism by inheritance Polymorphism by interfaces Reading for this lecture: L&L.
Aalborg Media Lab 23-Jun-15 Inheritance Lecture 10 Chapter 8.
Aalborg Media Lab 27-Jun-15 Workshop / Exercises Lecture 9 Summary, Exercises.
Chapter Day 21. © 2007 Pearson Addison-Wesley. All rights reserved7-2 Agenda Day 20 Problem set 4 Posted  10 problems from chapters 7 & 8  Due Nov 21.
Chapter 8 Inheritance. © 2004 Pearson Addison-Wesley. All rights reserved8-2 Inheritance Inheritance is a fundamental object-oriented design technique.
Vocabulary Key Terms polymorphism - Selecting a method among many methods that have the same name. subclass - A class that inherits variables and methods.
Inheritance. © 2004 Pearson Addison-Wesley. All rights reserved 8-2 Inheritance Inheritance is a fundamental object-oriented design technique used to.
Chapter 10: Inheritance 1. Inheritance  Inheritance allows a software developer to derive a new class from an existing one  The existing class is called.
© 2004 Pearson Addison-Wesley. All rights reserved8-1 Chapter 8 : Inheritance Intermediate Java Programming Summer 2007.
CSE 501N Fall ‘09 15: Polymorphism October 22, 2009 Nick Leidenfrost.
Specialization and Inheritance Chapter 8. 8 Specialization Specialized classes inherit the properties and methods of the parent or base class. A dog is.
11 Chapter 11 Object-Oriented Databases Database Systems: Design, Implementation, and Management 4th Edition Peter Rob & Carlos Coronel.
1 Given the Radio class  We may define other derivative types: Cassette walkman IS-A radio Alarm clock radio IS-A radio Car radio IS-A radio.
CS212: Object Oriented Analysis and Design Lecture 15: Inheritance in C++ -II.
Chapter 8 Inheritance Part 2. © 2004 Pearson Addison-Wesley. All rights reserved2/23 Outline Creating Subclasses Overriding Methods Class Hierarchies.
CSE 341, S. Tanimoto Java brief review - 1 Java Brief Review Java’s strengths Object-oriented terminology Inheritance Interfaces An example with inheritance.
Outline Creating Subclasses Overriding Methods Class Hierarchies Visibility Designing for Inheritance Inheritance and GUIs The Timer Class Copyright ©
8. Inheritance “Is-a” Relationship. Topics Creating Subclasses Overriding Methods Class Hierarchies Abstract Class Inheritance and GUIs The Timer Class.
Copyright © 2009 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Java Software Solutions Foundations of Program Design Sixth Edition by Lewis.
Inheritance. Inheritance is a fundamental object-oriented design technique used to create and organize reusable classes Chapter 8 focuses on: deriving.
Inheritance Inheritance allows a programmer to derive a new class from an existing one The existing class is called the super class, or parent class,
Inheritance Objectives: Creating new classes from existing classes The protected modifier Creating class hierarchies Abstract classes Indirect visibility.
Chapter 8 Specialization aka Inheritance. 2 Inheritance  Review of class relationships  Uses – One class uses the services of another class, either.
Chapter 8 Inheritance. 2  Review of class relationships  Uses – One class uses the services of another class, either by making objects of that class.
Encapsulation ◦ Blackbox concept Data and method(s) Hidden details InterfaceEffect(s) methods called class.
Coming up: Inheritance
© 2004 Pearson Addison-Wesley. All rights reserved April 14, 2006 Polymorphism ComS 207: Programming I (in Java) Iowa State University, SPRING 2006 Instructor:
1 Inheritance Reserved word protected Reserved word super Overriding methods Class Hierarchies Reading for this lecture: L&L 9.1 – 9.4.
CET203 SOFTWARE DEVELOPMENT Session 2A Inheritance (programming in C#)
Java Software Solutions Lewis and Loftus Chapter 8 Copyright 1997 by John Lewis and William Loftus. All rights reserved. 1 Inheritance -- Introduction.
Copyright © 2009 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Java Software Solutions Foundations of Program Design Sixth Edition by Lewis.
Banaras Hindu University. A Course on Software Reuse by Design Patterns and Frameworks.
CompSci Reading from Files  import java.io.File;  Declare a file File fileOfCats = new File(”cats.txt”);  Use file – pass it as an argument to.
Copyright © 2009 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Outline Creating Subclasses Overriding Methods Class Hierarchies Inheritance.
Java Programming Fifth Edition Chapter 9 Introduction to Inheritance.
Sections Inheritance and Abstract Classes
Lecture 12 Inheritance.
© 2016, Mike Murach & Associates, Inc.
One class is an extension of another.
03/10/14 Inheritance-2.
Inheritance Inheritance allows a programmer to derive a new class from an existing one The existing class is called the super class, or parent class,
An Introduction to Inheritance
Lecture 14 - Abstract Classes
One class is an extension of another.
Figure 8.1 Inheritance: Relationships among timepieces.
Domain Class Diagram Chapter 4 Part 2 pp
Lecture 14- Abstract Classes
Code reuse through subtyping
Chapter 7 Polymorphism.
Overriding Methods & Class Hierarchies
Java Programming, Second Edition
Chapter 8 Inheritance Part 2.
Extending Classes Through Inheritance
Chapter 7 Inheritance.
Figure 8.1 Inheritance: Relationships among timepieces.
Presentation transcript:

Aalborg Media Lab 19-Jun-15 Exercises/Summary Lecture 12 Summary, Exercises

Aalborg Media Lab 19-Jun-15 Summary of Inheritance SD10 has focused on: –Deriving a new class from a existing one –Purpose of reusing code –Inheritance -> “is a” relationship –Concept of parent & child –Abstract classes –Object class –A child class can override (re-define) parent functions –Timer class

Aalborg Media Lab 19-Jun-153 Inheritance Inheritance allows a software developer to derive a new class from an existing one The existing class is called the parent class, or superclass, or base class The derived class is called the child class or subclass. As the name implies, the child inherits characteristics of the parent. (data & methods)

Aalborg Media Lab 19-Jun-154 Class Hierarchies A child class of one parent can be the parent of another child, forming a class hierarchy Business KMartMacys ServiceBusiness Kinkos RetailBusiness

Aalborg Media Lab 19-Jun-15 Exercises & PP from SD10 Exercises –8.1, 8.2, 8.3 Programming Projects –8.2, 8.6, 8.7

Aalborg Media Lab 19-Jun-15 Programming Project 8.2 Employee DoctorNurse Admin./ Other Employee Medical Employee SurgeonJanitorReceptionist

Aalborg Media Lab 19-Jun-15

Aalborg Media Lab 19-Jun-15 Exercises so far LectureExercises SD2 – , 2.5, 2.9, 2.11, 2.13, (2.15) SD3 – – 3.5 SD4 – , 4.8, 4.10 SD5 – , 5.2, 5.13 SD6 – SD8 – , 7.3, 7.6, 7.12 SD10 – , 8.6, 8.7