Download presentation
Presentation is loading. Please wait.
1
ITK 168 Lecture 5 - Inheritance
2
Examples Review ExperimentRobot Lamp example
3
Overriding methods Overriding occurs when a subclass implements a method of the same name as the superclass causing a change in behavior
4
Override example Spinner robot Bad robot
Does 360 spin before turning left Bad robot Turns right when supposed to turn left Turns left when supposed to turn right
5
Method Resolution Robot RobotSE void move() void turnLeft() BadRobot
void turnAround() void turnRight() BadRobot void turnLeft() void turnRight()
6
Overriding with side effects
Speedy
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.