public class CityPop implements Comparable { // store a city name and its population // provide a comparator with other CityPop objects private String name; // beware: it may contain spaces! private Integer pop; // beware: the number you read may contain commas public CityPop(String n, int p) { // You need to instantiate the instance variables } public String getName() { return name; } public Integer getPop() { return pop; } public int compareTo(CityPop other) { // This comparator leads to the wrong order // it will go least to largest population // you need the opposite return getPop().compareTo(other.getPop()); } }