Programming Languages and Techniques (CIS120)

Size: px
Start display at page:

Download "Programming Languages and Techniques (CIS120)"

Transcription

1 Programming Languages and Techniques (CIS120) Lecture 25 November 1, 2017 Inheritance and Dynamic Dispatch (Chapter 24)

2 Announcements HW7: Chat Client Available Soon Due: Tuesday, November 14 th at 11:59pm Upcoming: Midterm 2 Friday, November 10 th in class Covers: Mutable state (in OCaml and Java) Objects (in OCaml and Java) ASM (in OCaml and Java) ReacSve programming (in OCaml) Arrays (in Java) Subtyping & Simple Extension (in Java) CIS120 2

3 OOooooo programming OO Subtypes

4 Interfaces Give a type for an object based on what it does, not on how it was constructed Describes a contract that objects must sassfy Example: Interface for objects that have a posison and can be moved keyword public interface Displaceable { public int getx(); public int gety(); public void move(int dx, int dy); No fields, no constructors, no method bodies!

5 ImplemenSng the interface A class that implements an interface provides appropriate definisons for the methods specified in the interface That class fulfills the contract implicit in the interface methods required to sassfy contract public class Point implements Displaceable { private int x, y; public Point(int x0, int y0) { x = x0; y = y0; public int getx() { return x; public int gety() { return y; public void move(int dx, int dy) { x = x + dx; y = y + dy; interfaces implemented

6 Another implementason public class Circle implements Displaceable { private Point center; private int radius; public Circle(Point initcenter, int initradius) { center = initcenter; radius = initradius; public int getx() { return center.getx(); public int gety() { return center.gety(); public void move(int dx, int dy) { center.move(dx, dy); Objects with different Delega)on: move the local state can sassfy circle by moving the the same interface center

7 The following snippet of code typechecks: public void moveitalot (Displaceable s) { //omitted // elsewhere Circle c = new Circle(10,10,10); moveitalot(c); 1. True 2. False Answer: True

8 Subtypes and Supertypes An interface represents a point of view about an object Classes can implement mul)ple interfaces interfaces classes implement interfaces classes Types can have many different supertypes / subtypes

9 Extension 1. Interface extension 2. Class extension (Simple inheritance)

10 Class Extension: Inheritance public class DisplaceableImpl implements Displaceable { private double x; private double y; public DisplaceableImpl(double x, double y) { this.x = x; this.y = y; public double getx() { return x; public double gety() { return y; public void move(double dx, double dy) { x = x + dx; y = y + dy; public class Circle extends DisplaceableImpl { private int radius; public Circle(int x, int y, int radius) { super(x,y); this.radius = radius; public int getradius() { return radius;

11 Interface Extension Build richer interface hierarchies by extending exissng interfaces. public interface Displaceable { double getx(); double gety(); void move(double dx, double dy); The Shape type includes all the methods of Displaceable and Area, plus the new getboundingbox method. public interface Area { double getarea(); public interface Shape extends Displaceable, Area { Rectangle getboundingbox(); Note the use of the extends keyword.

12 Interface Hierarchy Displaceable Area Shape Point Circle Rectangle class Point implements Displaceable { // omitted class Circle implements Shape { // omitted class Rectangle implements Shape { // omitted Shape is a subtype of both Displaceable and Area. Circle and Rectangle are both subtypes of Shape, and, by transi)vity, both are also subtypes of Displaceable and Area. Note that one interface may extend several others. Interfaces do not necessarily form a tree, but the hierarchy has no cycles.

13 Class Extension: Inheritance Classes, like interfaces, can also extend one another. Unlike interfaces, a class can extend only one other class. The extending class inherits all of the fields and methods of its superclass, may include addisonal fields or methods. This captures the is a relasonship between objects (e.g. a Car is a Vehicle). Class extension should never be used when is a does not relate the subtype to the supertype.

14 Simple Inheritance In simple inheritance, the subclass only adds new fields or methods. Use simple inheritance to share common code among related classes. Example: Circle, and Rectangle have iden)cal code for getx(), gety(), and move() methods when implemensng Displaceable.

15 Subtyping with Inheritance Displaceable Area DisplaceableImpl Shape Point Circle Rectangle Extends Implements - Type C is a subtype of D if D is reachable from C by following zero or more edges upwards in the hierarchy. - e.g. Circle is a subtype of Area, but Point is not

16 Example of Simple Inheritance See: Shapes.zip

17 Inheritance: Constructors Contructors cannot be inherited They have the wrong names! A subclass invokes the constructor of its super class using the keyword super. Super must be the first line of the subclass constructor if the parent class constructor takes no arguments, it is OK to omit the call to super. It is then called implicitly.

18 Class Extension: Inheritance public class DisplaceableImpl implements Displaceable { private double x; private double y; public DisplaceableImpl(double x, double y) { this.x = x; this.y = y; public double getx() { return x; public double gety() { return y; public void move(double dx, double dy) { x = x + dx; y = y + dy; public class Circle extends DisplaceableImpl { private int radius; public Circle(int x, int y, int radius) { super(x,y); this.radius = radius; public int getradius() { return radius;

19 Other forms of inheritance Java has other features related to inheritance (some of which we will discuss later in the course): A subclass might override (re-implement) a method already found in the superclass. A class might be abstract i.e. it does not provide implementasons for all of its methods (its subclasses must provide them instead) These features are hard to use properly, and the need for them arises only in somewhat special cases Making reusable libraries Special methods: equals and tostring We recommend avoiding all forms of inheritance (even simple inheritance ) when possible prefer interfaces and composison. Especially: avoid overriding.

20 Main idea: Subtype Polymorphism* Anywhere an object of type A is needed, an object that is a subtype of A can be provided. // in class C public static void leapit(displaceableimpl c) { c.move(1000,1000); // somewhere else C.leapIt(new Circle (10)); If B is a subtype of A, it provides all of A s (public) methods. Due to dynamic dispatch, the behavior of a method depends on B s implementason. Simple inheritance means B's method is inherited from A Otherwise, behavior of B should be compasble with A s behavior *polymorphism = many shapes

21 Object public class Object { boolean equals(object o) { // test for equality String tostring() { // return a string representation // other methods omitted Object is the root of the class tree. Classes that leave off the extends clause implicitly extend Object Arrays also implement the methods of Object This class provides methods useful for all objects to support Object is the highest type in the subtyping hierarchy.

22 Object Recap: Subtyping classes (form a tree) interfaces Displaceable Area DisplaceableImpl Shape Point Circle Rectangle Extends Implements Subtype by fiat - Interfaces extend (possibly many) interfaces - Classes implement (possibly many) interfaces - Classes (except Object) extend exactly one other class (Object by default) - Interface types (and arrays) are subtypes by fiat of Object

23 When do constructors execute? How are fields accessed? What code runs in a method call?

24 How do method calls work? What code gets run in a method invocason? o.move(3,4); When that code is running, how does it access the fields of the object that invoked it? x = x + dx; When does the code in a constructor get executed? What if the method was inherited from a superclass?

25 ASM refinement: The Class Table Class Table public class Counter { private int x; public Counter () { x = 0; public void incby(int d) { x = x + d; public int get() { return x; public class extends Counter { private int y; public (int inity) { y = inity; public void dec() { incby(-y); The class table contains: the code for each method, references to each class s parent, and the class s stasc members. Object String tostring(){ boolean equals Counter extends Counter() { x = 0; void incby(int d){ int get() {return x; extends (int inity) { void dec(){incby(-y);

26 this Inside a non-stasc method, the variable this is a reference to the object on which the method was invoked. References to local fields and methods have an implicit this. in front of them. class C { private int f; public void copyf(c other) { this.f = other.f; this Stack Heap C f 0

27 An Example public class Counter { private int x; public Counter () { x = 0; public void incby(int d) { x = x + d; public int get() { return x; public class extends Counter { private int y; public (int inity) { y = inity; public void dec() { incby(-y); // somewhere in main: d = new (2); d.dec(); int x = d.get();

28 with Explicit this and super public class Counter extends Object { private int x; public Counter () { super(); this.x = 0; public void incby(int d) { this.x = this.x + d; public int get() { return this.x; public class extends Counter { private int y; public (int inity) { super(); this.y = inity; public void dec() { this.incby(-this.y); // somewhere in main: d = new (2); d.dec(); int x = d.get();

29 ConstrucSng an Object Workspace Stack Heap d = new (2); d.dec(); int x = d.get(); Class Table Object String tostring(){ boolean equals Counter extends Counter() { x = 0; void incby(int d){ int get() {return x; extends (int inity) { void dec(){incby(-y);

30 AllocaSng Space on the Heap Workspace Stack Heap Class Table super(); this.y = inity; d = _; d.dec(); int x = d.get(); this x 0 y 0 Object String tostring(){ boolean equals inity 2 Invoking a constructor: allocates space for a new object in the heap includes slots for all fields of all ancestors in the class tree (here: x and y) creates a pointer to the class this is the object s dynamic type runs the constructor body aper pushing parameters and this onto the stack Note: fields start with a sensible default - 0 for numeric values - null for references Counter extends Object Counter() { x = 0; void incby(int d){ int get() {return x; extends Counter (int inity) { void dec(){incby(-y);

31 Calling super Workspace Stack Heap Class Table super(); this.y = inity; d = _; d.dec(); int x = d.get(); this x 0 y 0 Object String tostring(){ boolean equals inity 2 Counter extends Object Call to super: The constructor (implicitly) calls the super constructor Invoking a method/constructor pushes the saved workspace, the method params (none here) and a new this pointer. Counter() { x = 0; void incby(int d){ int get() {return x; extends Counter (int inity) { void dec(){incby(-y);

32 Abstract Stack Machine Workspace Stack Heap Class Table super(); this.x = 0; d = _; d.dec(); int x = d.get(); this x 0 y 0 Object String tostring(){ boolean equals inity 2 _; this.y = inity; this Counter extends Object (Running Object s default constructor omiqed.) Counter() { x = 0; void incby(int d){ int get() {return x; extends Counter (int inity) { void dec(){incby(-y);

33 Assigning to a Field Workspace Stack Heap Class Table this.x = 0; d = _; d.dec(); int x = d.get(); this x 0 y 0 Object String tostring(){ boolean equals inity 2 _; this.y = inity; this Counter extends Object Assignment into the this.x field goes in two steps: - look up the value of this in the stack - write to the x slot of that object. Counter() { x = 0; void incby(int d){ int get() {return x; extends Counter (int inity) { void dec(){incby(-y);

34 Assigning to a Field Workspace Stack Heap Class Table.x = 0; d = _; d.dec(); int x = d.get(); this x 0 y 0 Object String tostring(){ boolean equals inity 2 _; this.y = inity; this Counter extends Object Assignment into the this.x field goes in two steps: - look up the value of this in the stack - write to the x slot of that object. Counter() { x = 0; void incby(int d){ int get() {return x; extends Counter (int inity) { void dec(){incby(-y);

35 Done with the call Workspace Stack Heap Class Table ; d = _; d.dec(); int x = d.get(); this x 0 y 0 Object String tostring(){ boolean equals inity 2 _; this.y = inity; this Counter extends Object Done with the call to super, so pop the stack to the previous workspace. Counter() { x = 0; void incby(int d){ int get() {return x; extends Counter (int inity) { void dec(){incby(-y);

36 ConSnuing Workspace Stack Heap Class Table this.y = inity; d = _; d.dec(); int x = d.get(); this x 0 y 0 Object String tostring(){ boolean equals inity 2 Counter extends Object ConSnue in the class s constructor. Counter() { x = 0; void incby(int d){ int get() {return x; extends Counter (int inity) { void dec(){incby(-y);

37 Abstract Stack Machine Workspace Stack Heap Class Table this.y = 2; d = _; d.dec(); int x = d.get(); this x 0 y 0 Object String tostring(){ boolean equals inity 2 Counter extends Object Counter() { x = 0; void incby(int d){ int get() {return x; extends Counter (int inity) { void dec(){incby(-y);

38 Assigning to a field Workspace Stack Heap Class Table this.y = 2; d = _; d.dec(); int x = d.get(); this x 0 y 2 Object String tostring(){ boolean equals inity 2 Counter extends Object Assignment into the this.y field. (This really takes two steps as we saw earlier, but we re skipping some for the sake of brevity ) Counter() { x = 0; void incby(int d){ int get() {return x; extends Counter (int inity) { void dec(){incby(-y);

39 Done with the call Workspace Stack Heap Class Table ; d = _; d.dec(); int x = d.get(); this x 0 y 2 Object String tostring(){ boolean equals inity 2 Counter extends Object Done with the call to the constructor, so pop the stack and return to the saved workspace, returning the newly allocated object (now in the this pointer). Counter() { x = 0; void incby(int d){ int get() {return x; extends Counter (int inity) { void dec(){incby(-y);

40 Returning the Newly Constructed Object Workspace Stack Heap Class Table d = ; d.dec(); int x = d.get(); x 0 y 2 Object String tostring(){ boolean equals ConSnue execusng the program. Counter extends Object Counter() { x = 0; void incby(int d){ int get() {return x; extends Counter (int inity) { void dec(){incby(-y);

41 AllocaSng a local variable Workspace Stack Heap Class Table d.dec(); int x = d.get(); d x 0 Object String tostring(){ y 2 boolean equals Counter extends Object Allocate a stack slot for the local variable d. Note that it s mutable (bold box in the diagram). Aside: since, by default, fields and local variables are mutable, we open omit the bold boxes and just assume the contents can be modified. Counter() { x = 0; void incby(int d){ int get() {return x; extends Counter (int inity) { void dec(){incby(-y);

42 Dynamic Dispatch: Finding the Code Workspace Stack Heap Class Table.dec(); int x = d.get(); d x 0 Object String tostring(){ y 2 boolean equals Counter extends Object Invoke the dec method on the object. The code is found by pointer chasing through the class hierarchy. This process is called dynamic dispatch: Which code is run depends on the dynamic class of the object. (In this case,.) Search through the methods of the, class trying to find one called dec. Counter() { x = 0; void incby(int d){ int get() {return x; extends Counter (int inity) { void dec(){incby(-y);

43 Dynamic Dispatch: Finding the Code Workspace Stack Heap Class Table this.incby(-this.y); d Object _; int x = d.get(); this x 0 y 2 String tostring(){ boolean equals Counter extends Object Call the method, remembering the current workspace and pushing the this pointer and any arguments (none in this case). Counter() { x = 0; void incby(int d){ int get() {return x; extends Counter (int inity) { void dec(){incby(-y);

44 Reading A Field s Contents Workspace Stack Heap Class Table this.incby(-.y); d Object _; int x = d.get(); this x 0 y 2 String tostring(){ boolean equals Counter extends Object Read from the y slot of the object. Counter() { x = 0; void incby(int d){ int get() {return x; extends Counter (int inity) { void dec(){incby(-y);

45 Dynamic Dispatch, Again Workspace Stack Heap Class Table.incBy(-2); d Object _; int x = d.get(); this x 0 y 2 String tostring(){ boolean equals Invoke the incby method on the object via dynamic dispatch. In this case, the incby method is inherited from the parent, so dynamic dispatch must search up the class tree, looking for the implementason code. The search is guaranteed to succeed Java s stasc type system ensures this. Search through the methods of the, class trying to find one called incby. If the search fails, recursively search the parent classes. Counter extends Object Counter() { x = 0; void incby(int d){ int get() {return x; extends Counter (int inity) { void dec(){incby(-y);

46 Running the body of incby Workspace Stack Heap Class Table this.x = this.x + d; d Object this.x = -2; _; int x = d.get(); this _; x -20 y 2 String tostring(){ boolean equals d -2 Counter extends Object this Counter() { x = 0; It takes a few steps Body of incby: - reads this.x - looks up d - computes result this.x + d - stores the answer (-2) in this.x void incby(int d){ int get() {return x; extends Counter (int inity) { void dec(){incby(-y);

47 Aper a few more steps Workspace Stack Heap Class Table int x = d.get(); d Object x -2 String tostring(){ y 2 boolean equals Counter extends Object Counter() { x = 0; Now use dynamic dispatch to invoke the get method for d. This involves searching up the class hierarchy again void incby(int d){ int get() {return x; extends Counter (int inity) { void dec(){incby(-y);

48 Aper yet a few more steps Workspace Stack Heap Class Table ; d Object x -2 x -2 String tostring(){ y 2 boolean equals Counter extends Object Counter() { x = 0; void incby(int d){ Done! (Phew!) int get() {return x; extends Counter (int inity) { void dec(){incby(-y);

49 Summary: this and dynamic dispatch When object s method is invoked, as in o.m(), the code that runs is determined by o s dynamic class. The dynamic class, represented as a pointer into the class table, is included in the object structure in the heap If the method is inherited from a superclass, determining the code for m might require searching up the class hierarchy via pointers in the class table This process of dynamic dispatch is the heart of OOP! Once the code for m has been determined, a binding for this is pushed onto the stack. The this pointer is used to resolve field accesses and method invocasons inside the code.

50 Refinements to the Stack Machine Code is stored in a class table, which is a special part of the heap: When a program starts, the JVM inisalizes the class table Each class has a pointer to its (unique) parent in the class tree A class stores the constructor and method code for its instances The class also stores sta)c members Constructors: Allocate space in the heap (Implicitly) invoke the superclass constructor, then run the constructor body Objects and their methods: Each object in the heap has a pointer to the class table of its dynamic type (the one it was created with via new). A method invocason o.m( ) uses o s class table to dispatch to the appropriate method code (might involve searching up the class hierarchy). Methods and constructors take an implicit this parameter, which is a pointer to the object whose method was invoked. Fields& methods are accessed with this.

Programming Languages and Techniques (CIS120)

Programming Languages and Techniques (CIS120) Programming Languages and Techniques (CIS120) Lecture 26 March 26, 2015 Inheritance and Dynamic Dispatch Chapter 24 public interface Displaceable { public int getx(); public int gety(); public void move

More information

Programming Languages and Techniques (CIS120)

Programming Languages and Techniques (CIS120) Programming Languages and Techniques (CIS120) Lecture 25 March 18, 2013 Subtyping and Dynamic Dispatch Announcements HW07 due tonight at midnight Weirich OH cancelled today Help your TAs make the most

More information

Programming Languages and Techniques (CIS120)

Programming Languages and Techniques (CIS120) Programming Languages and Techniques (CIS120) Lecture 26 March 23, 2016 Inheritance and Dynamic Dispatch Chapter 24 Inheritance Example public class { private int x; public () { x = 0; } public void incby(int

More information

Programming Languages and Techniques (CIS120)

Programming Languages and Techniques (CIS120) Programming Languages and Techniques (CIS120) Lecture 24 October 29, 2018 Arrays, Java ASM Chapter 21 and 22 Announcements HW6: Java Programming (Pennstagram) Due TOMORROW at 11:59pm Reminder: please complete

More information

Programming Languages and Techniques (CIS120)

Programming Languages and Techniques (CIS120) Programming Languages and Techniques (CIS120) Lecture 26 November 3, 2017 The Java ASM, Java Generics Chapter 24 Announcements HW7: Chat Server Available on Codio / InstrucNons on the web site Due Tuesday,

More information

Programming Languages and Techniques (CIS120)

Programming Languages and Techniques (CIS120) Programming Languages and Techniques (CIS120) Lecture 24 March 24, 2014 Java ASM Interfaces and Subtyping Announcements HW 07 due tomorrow at midnight Exam 2, in class, a week from Friday (April 4th) The

More information

Programming Languages and Techniques (CIS120)

Programming Languages and Techniques (CIS120) Programming Languages and Techniques (CIS120) Lecture 21 March 12, 2018 Java: Objects, Interfaces, Static Members Chapters 19 & 20 Announcements Java Bootcamp Tonight!! Towne 100, 6-8 pm HW06: Pennstagram

More information

Programming Languages and Techniques (CIS120)

Programming Languages and Techniques (CIS120) Programming Languages and Techniques (CIS120) Lecture 22 March 14 th, 2016 Object Oriented Programming in Java Java Bootcamp tonight Announcements Monday, March 14 from 6-8pm in Levine 101 (Wu & Chen)

More information

CIS 120 Midterm II March 31, 2017 SOLUTIONS

CIS 120 Midterm II March 31, 2017 SOLUTIONS CIS 120 Midterm II March 31, 2017 SOLUTIONS 1 1. OCaml and Java (14 points) Check one box for each part. a. The following OCaml function will terminate by exhausting stack space if called as loop 10: let

More information

Programming Languages and Techniques (CIS120)

Programming Languages and Techniques (CIS120) Programming Languages and Techniques (CIS120) Lecture 22 March 14, 2018 Static Methods, Java Arrays Chapters 20 & 21 Announcements HW6: Java Programming (Pennstagram) Due: Tuesday the 20 th at 11:59pm

More information

ITI Introduction to Computing II

ITI Introduction to Computing II ITI 1121. Introduction to Computing II Marcel Turcotte School of Electrical Engineering and Computer Science Inheritance Introduction Generalization/specialization Version of January 20, 2014 Abstract

More information

ITI Introduction to Computing II

ITI Introduction to Computing II ITI 1121. Introduction to Computing II Marcel Turcotte School of Electrical Engineering and Computer Science Inheritance Introduction Generalization/specialization Version of January 21, 2013 Abstract

More information

Outline. Inheritance. Abstract Classes Interfaces. Class Extension Overriding Methods Inheritance and Constructors Polymorphism.

Outline. Inheritance. Abstract Classes Interfaces. Class Extension Overriding Methods Inheritance and Constructors Polymorphism. Outline Inheritance Class Extension Overriding Methods Inheritance and Constructors Polymorphism Abstract Classes Interfaces 1 OOP Principles Encapsulation Methods and data are combined in classes Not

More information

Programming Languages and Techniques (CIS120)

Programming Languages and Techniques (CIS120) Programming Languages and Techniques (CIS120) Lecture 36 April 23, 2014 Overriding and Equality HW 10 has a HARD deadline Announcements You must submit by midnight, April 30 th Demo your project to your

More information

Programming Languages and Techniques (CIS120)

Programming Languages and Techniques (CIS120) Programming Languages and Techniques (CIS120) Lecture 20 Feb 29, 2012 Transi@on to Java II DON T PANIC Smoothing the transi@on Eclipse set- up instruc@ons in lab today/tomorrow First Java homework assignment

More information

Programming Languages and Techniques (CIS120)

Programming Languages and Techniques (CIS120) Programming Languages and Techniques (CIS120) Lecture 31 April 3, 2013 Overriding, Equality, and Casts Announcements HW 09 due Tuesday at midnight More informajon about exam 2 available on Friday Unfinished

More information

Programming Languages and Techniques (CIS120)

Programming Languages and Techniques (CIS120) Programming Languages and Techniques (CIS120) Lecture 28 March 30, 2016 Collections and Equality Chapter 26 Announcements Dr. Steve Zdancewic is guest lecturing today He teaches CIS 120 in the Fall Midterm

More information

CIS 120 Midterm II November 16, 2012 SOLUTIONS

CIS 120 Midterm II November 16, 2012 SOLUTIONS CIS 120 Midterm II November 16, 2012 SOLUTIONS 1 1. Java vs. OCaml (22 points) a. In OCaml, the proper way to check whether two string values s and t are structurally equal is: s == t s = t s.equals(t)

More information

Announcements) Programming)Languages)) and)techniques) (CIS120)) FirstWclass)funcTons)via)inner)classes) Anonymous)Inner)Classes) Lecture)26)

Announcements) Programming)Languages)) and)techniques) (CIS120)) FirstWclass)funcTons)via)inner)classes) Anonymous)Inner)Classes) Lecture)26) Programming)Languages)) and)techniques) (CIS120)) Lecture)26) March)28,)2014) )Extension) Announcements) HW08)(GUI)Programming)II))is)due)next)Tuesday)at) 11:59:59pm) Midterm(2(is(Friday,((April(4 th (in(class(

More information

CIS 120 Midterm II November 16, Name (printed): Pennkey (login id):

CIS 120 Midterm II November 16, Name (printed): Pennkey (login id): CIS 120 Midterm II November 16, 2012 Name (printed): Pennkey (login id): My signature below certifies that I have complied with the University of Pennsylvania s Code of Academic Integrity in completing

More information

Reusing Classes. Hendrik Speleers

Reusing Classes. Hendrik Speleers Hendrik Speleers Overview Composition Inheritance Polymorphism Method overloading vs. overriding Visibility of variables and methods Specification of a contract Abstract classes, interfaces Software development

More information

Java Object Oriented Design. CSC207 Fall 2014

Java Object Oriented Design. CSC207 Fall 2014 Java Object Oriented Design CSC207 Fall 2014 Design Problem Design an application where the user can draw different shapes Lines Circles Rectangles Just high level design, don t write any detailed code

More information

Programming Languages and Techniques (CIS120)

Programming Languages and Techniques (CIS120) Programming Languages and Techniques (CIS120) Lecture 21 March 6 th, 2015 Transi@on to Java CIS 120 Overview Declara@ve (Func@onal) programming persistent data structures recursion is main control structure

More information

CS-202 Introduction to Object Oriented Programming

CS-202 Introduction to Object Oriented Programming CS-202 Introduction to Object Oriented Programming California State University, Los Angeles Computer Science Department Lecture III Inheritance and Polymorphism Introduction to Inheritance Introduction

More information

Programming Languages and Techniques (CIS120)

Programming Languages and Techniques (CIS120) Programming Languages and Techniques (CIS120) Lecture 24 March 18, 2016 The Java ASM What is the value of ans at the end of this program? Counter[] a = { new Counter(), new Counter() ; Counter[] b = {

More information

Chapter 11 Inheritance and Polymorphism. Motivations. Suppose you will define classes to model circles,

Chapter 11 Inheritance and Polymorphism. Motivations. Suppose you will define classes to model circles, Chapter 11 Inheritance and Polymorphism 1 Motivations Suppose you will define classes to model circles, rectangles, and triangles. These classes have many common features. What is the best way to design

More information

Inheritance & Polymorphism Recap. Inheritance & Polymorphism 1

Inheritance & Polymorphism Recap. Inheritance & Polymorphism 1 Inheritance & Polymorphism Recap Inheritance & Polymorphism 1 Introduction! Besides composition, another form of reuse is inheritance.! With inheritance, an object can inherit behavior from another object,

More information

COMP200 INHERITANCE. OOP using Java, from slides by Shayan Javed

COMP200 INHERITANCE. OOP using Java, from slides by Shayan Javed 1 1 COMP200 INHERITANCE OOP using Java, from slides by Shayan Javed 2 Inheritance Derive new classes (subclass) from existing ones (superclass). Only the Object class (java.lang) has no superclass Every

More information

Inheritance and Polymorphism

Inheritance and Polymorphism Inheritance and Polymorphism Dr. M. G. Abbas Malik Assistant Professor Faculty of Computing and IT (North Jeddah Branch) King Abdulaziz University, Jeddah, KSA mgmalik@kau.edu.sa www.sanlp.org/malik/cpit305/ap.html

More information

Chapter 10 Inheritance and Polymorphism. Dr. Hikmat Jaber

Chapter 10 Inheritance and Polymorphism. Dr. Hikmat Jaber Chapter 10 Inheritance and Polymorphism Dr. Hikmat Jaber 1 Motivations Suppose you will define classes to model circles, rectangles, and triangles. These classes have many common features. What is the

More information

Programming Languages and Techniques (CIS120e)

Programming Languages and Techniques (CIS120e) Programming Languages and Techniques (CIS120e) Lecture 33 Dec. 1, 2010 Equality Consider this example public class Point {! private final int x; // see note about final*! private final int y;! public Point(int

More information

CH. 2 OBJECT-ORIENTED PROGRAMMING

CH. 2 OBJECT-ORIENTED PROGRAMMING CH. 2 OBJECT-ORIENTED PROGRAMMING ACKNOWLEDGEMENT: THESE SLIDES ARE ADAPTED FROM SLIDES PROVIDED WITH DATA STRUCTURES AND ALGORITHMS IN JAVA, GOODRICH, TAMASSIA AND GOLDWASSER (WILEY 2016) OBJECT-ORIENTED

More information

Featherweight Java (FJ)

Featherweight Java (FJ) x = 1 let x = 1 in... x(1).!x(1) x.set(1) Programming Language Theory Featherweight Java (FJ) Ralf Lämmel This lecture is based on David Walker s lecture: Computer Science 441, Programming Languages, Princeton

More information

Programming Languages and Techniques (CIS120)

Programming Languages and Techniques (CIS120) Programming Languages and Techniques (CIS120) Lecture 27 March 28, 2018 Java Generics Collections and Equality Chapters 25 & 26 Announcements HW7: Chat Server Available on Codio / Instructions on the web

More information

Programming Languages and Techniques (CIS120)

Programming Languages and Techniques (CIS120) Programming Languages and Techniques (CIS120) Lecture 32 April 5, 2013 Equality and Hashing When to override: Equality Consider this example public class Point { private final int x; private final int

More information

Programming Languages and Techniques (CIS120)

Programming Languages and Techniques (CIS120) Programming Languages and Techniques (CIS120) Lecture 28 November 8, 2017 Overriding Methods, Equality, Enums Chapter 26 Announcements HW7: Chat Server Available on Codio / InstrucNons on the web site

More information

CIS 110: Introduction to computer programming

CIS 110: Introduction to computer programming CIS 110: Introduction to computer programming Lecture 25 Inheritance and polymorphism ( 9) 12/3/2011 CIS 110 (11fa) - University of Pennsylvania 1 Outline Inheritance Polymorphism Interfaces 12/3/2011

More information

INHERITANCE & POLYMORPHISM. INTRODUCTION IB DP Computer science Standard Level ICS3U. INTRODUCTION IB DP Computer science Standard Level ICS3U

INHERITANCE & POLYMORPHISM. INTRODUCTION IB DP Computer science Standard Level ICS3U. INTRODUCTION IB DP Computer science Standard Level ICS3U C A N A D I A N I N T E R N A T I O N A L S C H O O L O F H O N G K O N G INHERITANCE & POLYMORPHISM P2 LESSON 12 P2 LESSON 12.1 INTRODUCTION inheritance: OOP allows a programmer to define new classes

More information

Lecture Notes on Programming Languages

Lecture Notes on Programming Languages Lecture Notes on Programming Languages 85 Lecture 09: Support for Object-Oriented Programming This lecture discusses how programming languages support object-oriented programming. Topics to be covered

More information

Example: Count of Points

Example: Count of Points Example: Count of Points 1 class Point { 2... 3 private static int numofpoints = 0; 4 5 Point() { 6 numofpoints++; 7 } 8 9 Point(int x, int y) { 10 this(); // calling the constructor with no input argument;

More information

Generic programming POLYMORPHISM 10/25/13

Generic programming POLYMORPHISM 10/25/13 POLYMORPHISM Generic programming! Code reuse: an algorithm can be applicable to many objects! Goal is to avoid rewri:ng as much as possible! Example: int sqr(int i, int j) { return i*j; double sqr(double

More information

G Programming Languages - Fall 2012

G Programming Languages - Fall 2012 G22.2110-003 Programming Languages - Fall 2012 Lecture 12 Thomas Wies New York University Review Last lecture Modules Outline Classes Encapsulation and Inheritance Initialization and Finalization Dynamic

More information

Methods Common to all Classes

Methods Common to all Classes Methods Common to all Classes 9-2-2013 OOP concepts Overloading vs. Overriding Use of this. and this(); use of super. and super() Methods common to all classes: tostring(), equals(), hashcode() HW#1 posted;

More information

Making New instances of Classes

Making New instances of Classes Making New instances of Classes NOTE: revised from previous version of Lecture04 New Operator Classes are user defined datatypes in OOP languages How do we make instances of these new datatypes? Using

More information

Programming Languages and Techniques (CIS120)

Programming Languages and Techniques (CIS120) Programming Languages and Techniques (CIS120) Lecture 28 March 30, 2018 Overriding Methods, Equality, Enums, Iterators Chapters 25 and 26 Method Overriding When a subclass replaces an inherited method

More information

Principles of Software Construction: Objects, Design, and Concurrency. Objects (continued) toad. Spring J Aldrich and W Scherlis

Principles of Software Construction: Objects, Design, and Concurrency. Objects (continued) toad. Spring J Aldrich and W Scherlis Principles of Software Construction: Objects, Design, and Concurrency Objects (continued) toad Spring 2012 Jonathan Aldrich Charlie Garrod School of Computer Science 2012 J Aldrich and W Scherlis Announcements

More information

Lecture Notes Chapter #9_b Inheritance & Polymorphism

Lecture Notes Chapter #9_b Inheritance & Polymorphism Lecture Notes Chapter #9_b Inheritance & Polymorphism Inheritance results from deriving new classes from existing classes Root Class all java classes are derived from the java.lang.object class GeometricObject1

More information

Inheritance Motivation

Inheritance Motivation Inheritance Inheritance Motivation Inheritance in Java is achieved through extending classes Inheritance enables: Code re-use Grouping similar code Flexibility to customize Inheritance Concepts Many real-life

More information

Inheritance and Polymorphism

Inheritance and Polymorphism Object Oriented Programming Designed and Presented by Dr. Ayman Elshenawy Elsefy Dept. of Systems & Computer Eng.. Al-Azhar University Website: eaymanelshenawy.wordpress.com Email : eaymanelshenawy@azhar.edu.eg

More information

Object Oriented Programming. Week 1 Part 3 Writing Java with Eclipse and JUnit

Object Oriented Programming. Week 1 Part 3 Writing Java with Eclipse and JUnit Object Oriented Programming Part 3 Writing Java with Eclipse and JUnit Today's Lecture Test Driven Development Review (TDD) Building up a class using TDD Adding a Class using Test Driven Development in

More information

Programming Languages and Techniques (CIS120e)

Programming Languages and Techniques (CIS120e) Programming Languages and Techniques (CIS120e) Lecture 25 Nov. 8, 2010 ExcepEons and the Java Abstract Stack Machine Announcements Homework 8 (SpellChecker) is due Nov 15th. Midterm 2 is this Friday, November

More information

1B1b Inheritance. Inheritance. Agenda. Subclass and Superclass. Superclass. Generalisation & Specialisation. Shapes and Squares. 1B1b Lecture Slides

1B1b Inheritance. Inheritance. Agenda. Subclass and Superclass. Superclass. Generalisation & Specialisation. Shapes and Squares. 1B1b Lecture Slides 1B1b Inheritance Agenda Introduction to inheritance. How Java supports inheritance. Inheritance is a key feature of object-oriented oriented programming. 1 2 Inheritance Models the kind-of or specialisation-of

More information

Instance Members and Static Members

Instance Members and Static Members Instance Members and Static Members You may notice that all the members are declared w/o static. These members belong to some specific object. They are called instance members. This implies that these

More information

Inheritance and Polymorphism

Inheritance and Polymorphism Inheritance and Polymorphism Recitation 10/(16,17)/2008 CS 180 Department of Computer Science, Purdue University Project 5 Due Wed, Oct. 22 at 10 pm. All questions on the class newsgroup. Make use of lab

More information

Outline. Java Models for variables Types and type checking, type safety Interpretation vs. compilation. Reasoning about code. CSCI 2600 Spring

Outline. Java Models for variables Types and type checking, type safety Interpretation vs. compilation. Reasoning about code. CSCI 2600 Spring Java Outline Java Models for variables Types and type checking, type safety Interpretation vs. compilation Reasoning about code CSCI 2600 Spring 2017 2 Java Java is a successor to a number of languages,

More information

Compiler construction 2009

Compiler construction 2009 Compiler construction 2009 Lecture 6 Some project extensions. Pointers and heap allocation. Object-oriented languages. Module systems. Memory structure Javalette restrictions Only local variables and parameters

More information

Programming Languages and Techniques (CIS120)

Programming Languages and Techniques (CIS120) Programming Languages and Techniques (CIS120) Lecture 28 November 7, 2018 Overriding Methods, Equality, Enums, Iterators Chapters 25 and 26 Announcements HW7: Chat Server Available on Codio / Instructions

More information

Name Return type Argument list. Then the new method is said to override the old one. So, what is the objective of subclass?

Name Return type Argument list. Then the new method is said to override the old one. So, what is the objective of subclass? 1. Overriding Methods A subclass can modify behavior inherited from a parent class. A subclass can create a method with different functionality than the parent s method but with the same: Name Return type

More information

HAS-A Relationship. Association is a relationship where all objects have their own lifecycle and there is no owner.

HAS-A Relationship. Association is a relationship where all objects have their own lifecycle and there is no owner. HAS-A Relationship Association is a relationship where all objects have their own lifecycle and there is no owner. For example, teacher student Aggregation is a specialized form of association where all

More information

CS5000: Foundations of Programming. Mingon Kang, PhD Computer Science, Kennesaw State University

CS5000: Foundations of Programming. Mingon Kang, PhD Computer Science, Kennesaw State University CS5000: Foundations of Programming Mingon Kang, PhD Computer Science, Kennesaw State University Inheritance Three main programming mechanisms that constitute object-oriented programming (OOP) Encapsulation

More information

CIS 120 Midterm II March 29, 2013 SOLUTIONS

CIS 120 Midterm II March 29, 2013 SOLUTIONS CIS 120 Midterm II March 29, 2013 SOLUTIONS 1 1. Java True/False (20 points) Circle T or F. a. T F In the Java ASM, object values are stored in the heap. b. T F In the Java ASM, method definitions are

More information

Object-oriented Programming. Object-oriented Programming

Object-oriented Programming. Object-oriented Programming 2014-06-13 Object-oriented Programming Object-oriented Programming 2014-06-13 Object-oriented Programming 1 Object-oriented Languages object-based: language that supports objects class-based: language

More information

ITI Introduction to Computing II

ITI Introduction to Computing II ITI 1121. Introduction to Computing II Marcel Turcotte School of Electrical Engineering and Computer Science Inheritance (part II) Polymorphism Version of January 21, 2013 Abstract These lecture notes

More information

ITI Introduction to Computing II

ITI Introduction to Computing II ITI 1121. Introduction to Computing II Marcel Turcotte School of Electrical Engineering and Computer Science Inheritance (part II) Polymorphism Version of January 21, 2013 Abstract These lecture notes

More information

CS250 Intro to CS II. Spring CS250 - Intro to CS II 1

CS250 Intro to CS II. Spring CS250 - Intro to CS II 1 CS250 Intro to CS II Spring 2017 CS250 - Intro to CS II 1 Topics Virtual Functions Pure Virtual Functions Abstract Classes Concrete Classes Binding Time, Static Binding, Dynamic Binding Overriding vs Redefining

More information

Programming Languages and Techniques (CIS120)

Programming Languages and Techniques (CIS120) Programming Languages and Techniques (CIS120) Lecture 23 March 16, 2018 Arrays, Java ASM What is the value of ans at the end of this program? int[] a = {1, 2, 3, 4; int[] b = a; b[0] = 0; int ans = a[0];

More information

CS 112 Programming 2. Lecture 06. Inheritance & Polymorphism (1) Chapter 11 Inheritance and Polymorphism

CS 112 Programming 2. Lecture 06. Inheritance & Polymorphism (1) Chapter 11 Inheritance and Polymorphism CS 112 Programming 2 Lecture 06 Inheritance & Polymorphism (1) Chapter 11 Inheritance and Polymorphism rights reserved. 2 Motivation Suppose you want to define classes to model circles, rectangles, and

More information

Inheritance (Deitel chapter 9)

Inheritance (Deitel chapter 9) Inheritance (Deitel chapter 9) 1 2 Plan Introduction Superclasses and Subclasses protected Members Constructors and Finalizers in Subclasses Software Engineering with Inheritance 3 Introduction Inheritance

More information

Agenda. Objects and classes Encapsulation and information hiding Documentation Packages

Agenda. Objects and classes Encapsulation and information hiding Documentation Packages Preliminaries II 1 Agenda Objects and classes Encapsulation and information hiding Documentation Packages Inheritance Polymorphism Implementation of inheritance in Java Abstract classes Interfaces Generics

More information

Inheritance. Inheritance

Inheritance. Inheritance 1 2 1 is a mechanism for enhancing existing classes. It allows to extend the description of an existing class by adding new attributes and new methods. For example: class ColoredRectangle extends Rectangle

More information

index.pdf January 21,

index.pdf January 21, index.pdf January 21, 2013 1 ITI 1121. Introduction to Computing II Circle Let s complete the implementation of the class Circle. Marcel Turcotte School of Electrical Engineering and Computer Science Version

More information

25. Generic Programming

25. Generic Programming 25. Generic Programming Java Fall 2009 Instructor: Dr. Masoud Yaghini Generic Programming Outline Polymorphism and Generic Programming Casting Objects and the instanceof Operator The protected Data and

More information

Lecture 13: Object orientation. Object oriented programming. Introduction. Object oriented programming. OO and ADT:s. Introduction

Lecture 13: Object orientation. Object oriented programming. Introduction. Object oriented programming. OO and ADT:s. Introduction Lecture 13: Object orientation Object oriented programming Introduction, types of OO languages Key concepts: Encapsulation, Inheritance, Dynamic binding & polymorphism Other design issues Smalltalk OO

More information

Object Oriented Programming. Java-Lecture 11 Polymorphism

Object Oriented Programming. Java-Lecture 11 Polymorphism Object Oriented Programming Java-Lecture 11 Polymorphism Abstract Classes and Methods There will be a situation where you want to develop a design of a class which is common to many classes. Abstract class

More information

ITI Introduction to Computing II

ITI Introduction to Computing II ITI 1121. Introduction to Computing II Marcel Turcotte School of Electrical Engineering and Computer Science Interface Abstract data types Version of January 26, 2013 Abstract These lecture notes are meant

More information

Computer Science 210: Data Structures

Computer Science 210: Data Structures Computer Science 210: Data Structures Summary Today writing a Java program guidelines on clear code object-oriented design inheritance polymorphism this exceptions interfaces READING: GT chapter 2 Object-Oriented

More information

OOP: Key Concepts 09/28/2001 1

OOP: Key Concepts 09/28/2001 1 OOP: Key Concepts Michael B. Spring Department of Information Science and Telecommunications University of Pittsburgh spring@imap.pitt.edu http://www.sis.pitt.edu/~spring 09/28/2001 1 Overview of Part

More information

Chapter 6 Introduction to Defining Classes

Chapter 6 Introduction to Defining Classes Introduction to Defining Classes Fundamentals of Java: AP Computer Science Essentials, 4th Edition 1 Objectives Design and implement a simple class from user requirements. Organize a program in terms of

More information

Compilers CS S-10 Object Oriented Extensions

Compilers CS S-10 Object Oriented Extensions Compilers CS414-2003S-10 Object Oriented Extensions David Galles Department of Computer Science University of San Francisco 10-0: Classes simplejava classes are equivalent to C structs class myclass {

More information

IST311. Advanced Issues in OOP: Inheritance and Polymorphism

IST311. Advanced Issues in OOP: Inheritance and Polymorphism IST311 Advanced Issues in OOP: Inheritance and Polymorphism IST311/602 Cleveland State University Prof. Victor Matos Adapted from: Introduction to Java Programming: Comprehensive Version, Eighth Edition

More information

Programming Languages and Techniques (CIS120)

Programming Languages and Techniques (CIS120) Programming Languages and Techniques (CIS120) Lecture 37 April 22, 2016 Encapsulation & Hashing How is the Game Project going so far? 1. not started 2. got an idea 3. submitted design proposal 4. started

More information

Advanced Placement Computer Science. Inheritance and Polymorphism

Advanced Placement Computer Science. Inheritance and Polymorphism Advanced Placement Computer Science Inheritance and Polymorphism What s past is prologue. Don t write it twice write it once and reuse it. Mike Scott The University of Texas at Austin Inheritance, Polymorphism,

More information

Name: Pennkey: CIS 120 Midterm II November 18, 2011

Name: Pennkey: CIS 120 Midterm II November 18, 2011 Name: Pennkey: CIS 120 Midterm II November 18, 2011 1 /20 2 /20 3 /20 4 /20 5 /20 Total /100 Do not begin the exam until you are told to do so. You have 50 minutes to complete the exam. There are 100 total

More information

Object Oriented Programming is a programming method that combines: Advantage of Object Oriented Programming

Object Oriented Programming is a programming method that combines: Advantage of Object Oriented Programming Overview of OOP Object Oriented Programming is a programming method that combines: a) Data b) Instructions for processing that data into a self-sufficient object that can be used within a program or in

More information

CS107 Handout 37 Spring 2007 May 25, 2007 Introduction to Inheritance

CS107 Handout 37 Spring 2007 May 25, 2007 Introduction to Inheritance CS107 Handout 37 Spring 2007 May 25, 2007 Introduction to Inheritance Handout written by Julie Zelenski, updated by Jerry. Inheritance is a language property most gracefully supported by the object-oriented

More information

Day 4. COMP1006/1406 Summer M. Jason Hinek Carleton University

Day 4. COMP1006/1406 Summer M. Jason Hinek Carleton University Day 4 COMP1006/1406 Summer 2016 M. Jason Hinek Carleton University today s agenda assignments questions about assignment 2 a quick look back constructors signatures and overloading encapsulation / information

More information

Inheritance (Part 5) Odds and ends

Inheritance (Part 5) Odds and ends Inheritance (Part 5) Odds and ends 1 Static Methods and Inheritance there is a significant difference between calling a static method and calling a non-static method when dealing with inheritance there

More information

OBJECT ORIENTED PROGRAMMING USING C++ CSCI Object Oriented Analysis and Design By Manali Torpe

OBJECT ORIENTED PROGRAMMING USING C++ CSCI Object Oriented Analysis and Design By Manali Torpe OBJECT ORIENTED PROGRAMMING USING C++ CSCI 5448- Object Oriented Analysis and Design By Manali Torpe Fundamentals of OOP Class Object Encapsulation Abstraction Inheritance Polymorphism Reusability C++

More information

Inheritance (cont.) Inheritance. Hierarchy of Classes. Inheritance (cont.)

Inheritance (cont.) Inheritance. Hierarchy of Classes. Inheritance (cont.) Inheritance Inheritance (cont.) Object oriented systems allow new classes to be defined in terms of a previously defined class. All variables and methods of the previously defined class, called superclass,

More information

Java Fundamentals (II)

Java Fundamentals (II) Chair of Software Engineering Languages in Depth Series: Java Programming Prof. Dr. Bertrand Meyer Java Fundamentals (II) Marco Piccioni static imports Introduced in 5.0 Imported static members of a class

More information

Type Hierarchy. Lecture 6: OOP, autumn 2003

Type Hierarchy. Lecture 6: OOP, autumn 2003 Type Hierarchy Lecture 6: OOP, autumn 2003 The idea Many types have common behavior => type families share common behavior organized into a hierarchy Most common on the top - supertypes Most specific at

More information

Day 3. COMP 1006/1406A Summer M. Jason Hinek Carleton University

Day 3. COMP 1006/1406A Summer M. Jason Hinek Carleton University Day 3 COMP 1006/1406A Summer 2016 M. Jason Hinek Carleton University today s agenda assignments 1 was due before class 2 is posted (be sure to read early!) a quick look back testing test cases for arrays

More information

Lecture 3. COMP1006/1406 (the Java course) Summer M. Jason Hinek Carleton University

Lecture 3. COMP1006/1406 (the Java course) Summer M. Jason Hinek Carleton University Lecture 3 COMP1006/1406 (the Java course) Summer 2014 M. Jason Hinek Carleton University today s agenda assignments 1 (graded) & 2 3 (available now) & 4 (tomorrow) a quick look back primitive data types

More information

Argument Passing All primitive data types (int etc.) are passed by value and all reference types (arrays, strings, objects) are used through refs.

Argument Passing All primitive data types (int etc.) are passed by value and all reference types (arrays, strings, objects) are used through refs. Local Variable Initialization Unlike instance vars, local vars must be initialized before they can be used. Eg. void mymethod() { int foo = 42; int bar; bar = bar + 1; //compile error bar = 99; bar = bar

More information

OOP Subtyping. Lecture 20

OOP Subtyping. Lecture 20 OOP Subtyping Lecture 20 Announcements WS05 - Posted yesterday, due Wednesday 11/8 at 11:59pm Explores recursion and object-oriented programming fundamentals Warm-up: What is printed? interface Transform

More information

Inheritance, Polymorphism, and Interfaces

Inheritance, Polymorphism, and Interfaces Inheritance, Polymorphism, and Interfaces Chapter 8 Inheritance Basics (ch.8 idea) Inheritance allows programmer to define a general superclass with certain properties (methods, fields/member variables)

More information

COS226 - Spring 2018 Class Meeting # 13 March 26, 2018 Inheritance & Polymorphism

COS226 - Spring 2018 Class Meeting # 13 March 26, 2018 Inheritance & Polymorphism COS226 - Spring 2018 Class Meeting # 13 March 26, 2018 Inheritance & Polymorphism Ibrahim Albluwi Composition A GuitarString has a RingBuffer. A MarkovModel has a Symbol Table. A Symbol Table has a Binary

More information

CMSC 132: Object-Oriented Programming II

CMSC 132: Object-Oriented Programming II CMSC 132: Object-Oriented Programming II Java Support for OOP Department of Computer Science University of Maryland, College Park Object Oriented Programming (OOP) OO Principles Abstraction Encapsulation

More information

M301: Software Systems & their Development. Unit 4: Inheritance, Composition and Polymorphism

M301: Software Systems & their Development. Unit 4: Inheritance, Composition and Polymorphism Block 1: Introduction to Java Unit 4: Inheritance, Composition and Polymorphism Aims of the unit: Study and use the Java mechanisms that support reuse, in particular, inheritance and composition; Analyze

More information

Introduction to Software Testing Chapter 2.4 Graph Coverage for Design Elements Paul Ammann & Jeff Offutt

Introduction to Software Testing Chapter 2.4 Graph Coverage for Design Elements Paul Ammann & Jeff Offutt Introduction to Software Testing Chapter 2.4 Graph Coverage for Design Elements Paul Ammann & Jeff Offutt www.introsoftwaretesting.com OO Software and Designs Emphasis on modularity and reuse puts complexity

More information