Class Truck
java.lang.Object
Vehicle
Car
Truck
public class Truck
- extends Car
A Truck to drive down the road.
Constructor Summary |
Truck()
Creates a new Truck object. |
Method Summary |
void |
draw(Canvas canvas)
Draws the Truck on the given Canvas |
void |
turn()
Turns the Truck--but trucks are too big to turn, so this method does nothing. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Truck
public Truck()
- Creates a new Truck object.
draw
public void draw(Canvas canvas)
- Draws the Truck on the given Canvas
- Overrides:
draw
in class Car
- Parameters:
canvas
- The canvas on which to draw
turn
public void turn()
- Turns the Truck--but trucks are too big to turn, so this method does nothing.
Overriding parent's method to remove functionality.
- Overrides:
turn
in class Vehicle