Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package ee.ttu.algoritmid.guessinggame;
- public class City implements Comparable<City> {
- private String name;
- private int population;
- public City(String name, int population) {
- this.name = name;
- this.population = population;
- }
- public String getName() {
- return this.name;
- }
- public Integer getPopulation() {
- return this.population;
- }
- @Override
- public int compareTo(City c) {
- return getPopulation().compareTo(c.getPopulation());
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement