Download presentation
Presentation is loading. Please wait.
Published byJeffrey James Modified over 9 years ago
8
Square draw() rotate() setLength() getLength() Circle draw() getRadius() setRadius() Shape Erase() Move() setX() setY() setColor() getPos() getColor() Triangle draw() rotate() setLength() getLength() Hexagon draw() rotate() setLength() getLength()
10
Reptile move() eat() reproduce() Animal move() eat() reproduce() Mammal move() eat() reproduce() Fish move() eat() reproduce() LionTigerBear
26
Pretend this method exists in our Shape implementation!
27
Same as Shape.rotate()
28
partial overriding
30
Subclass SuperclassInterface
42
ClassInterface Models an object with properties and behavior Models a role and defines a set of responsibilities Factors out common properties and behavior of similar objects Factors out common behavior, but not properties, of usually dissimilar objects Declares methods and may define some or all of them Declares but does not define methods Can only extend one superclassCan extend multiple interfaces Can implement any number of interfacesNo implementation
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.