Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Item implements Comparable<Item> {
- private String restOfString;
- private int numCompounds;
- public Item(String str, int num)
- {
- restOfString = str;
- numCompounds = num;
- }
- public int compareTo(Item other) {
- return this.numCompounds - other.numCompounds;
- }
- public String toString()
- {
- return new String(restOfString);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement