Commit b0bec6b4f287431ce09d9d97fba44427de7a2f2f

Authored by Thomas Røiri Aaslund
1 parent 7bc0946a

commit

Showing 2 changed files with 13 additions and 1 deletions   Show diff stats
Vehicle.java
... ... @@ -4,7 +4,7 @@ package vehicle;
4 4 import java.lang.*;
5 5 import java.util.*;
6 6  
7   -public abstract class Vehicle
  7 +public abstract class Vehicle implements Comparable<Vehicle>, Cloneable
8 8 {
9 9 String color;
10 10 String name;
... ... @@ -16,6 +16,17 @@ public abstract class Vehicle
16 16  
17 17 protected Scanner input = new Scanner(System.in);
18 18  
  19 + @Override
  20 + public Object clone()
  21 + {
  22 +
  23 + }
  24 +
  25 + @Override
  26 + public int compareTo(Vehicle rhs)
  27 + {
  28 + return (int)Math.signum(this.price - rhs.price);
  29 + }
19 30  
20 31 public Vehicle()
21 32 {
... ...
vehicle @ 7bc0946afae
  1 +Subproject commit 7bc0946afae94ff39c82f7b57540d427bd2d91c4
... ...