1public interface Order
2{
3 public boolean greaterThan(Order other);
4}
5
6public class AirCraft implements Order
7{
8 private String make;
9 private int numSeats;
10
11 public AirCraft(String make, int numSeats)
12 {
13 this.make = make;
14 this.numSeats = numSeats;
15 }
16
17 public String getMake()
18 {
19 return make;
20 }
21
22 public int getNumSeats()
23 {
24 return numSeats;
25 }
26
27 @Override
28 public boolean greaterThan(Order other)
29 {
30 AirCraft x = (AirCraft)other;
31 return getNumSeats() > x.getNumSeats();
32 }
33
34 public String toString()
35 {
36 return make + " -> " + numSeats;
37 }
38}