English subtitles

← A Second Interface - Intro to Java Programming

Get Embed Code
6 Languages

Showing Revision 4 created 05/25/2016 by Udacity Robot.

  1. So we wanted to make this dog move, simple enough. We simply make the dog move
  2. just the same as the car. But of course now we have to edit the dog class, and
  3. make the movement happen. There's the dog class. We add Moveable to the list of
  4. interfaces. And here's my move method. It's simply enough, I simply move both
  5. the picture of the dog and the name text. And I was asked to move it vertically
  6. at one pixel per second. That's why the horizontal displacement is zero and the
  7. vertical displacement is the same as the seconds. When you run the program,
  8. then here you can see the car move, and the dog move.