Advertisement
Guest User

Untitled

a guest
Nov 13th, 2019
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. public class Vehicle2010 extends Vehicle
  2. {
  3. void moveUpperRight()
  4. {
  5. x += 1;
  6. y += 1;
  7. }
  8.  
  9. void moveUpperLeft()
  10. {
  11. x -= 1;
  12. y += 1;
  13. }
  14.  
  15. void moveLowerRight()
  16. {
  17. x += 1;
  18. y -= 1;
  19. }
  20.  
  21. void moveLowerLeft()
  22. {
  23. x -= 1;
  24. y -= 1;
  25. }
  26.  
  27. public Boolean equals(Vehicle v)
  28. {
  29. if (x == v.x && y == v.y )
  30. {
  31. return true;
  32. }
  33. return false;
  34. }
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement