Commit d07671b1 authored by Trisha Gee's avatar Trisha Gee
Browse files

[Ch10b] Comparable Book for TreeSet

parent 42edba9a
Loading
Loading
Loading
Loading
+5 −2
Changes for src/main/java/ch10b/TestTree.java: 5 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -20,9 +20,12 @@ public class TestTree {
   }
}

class Book {
   String title;
class Book implements Comparable<Book> {
  private String title;
  public Book(String t) {
    title = t;
  }
  public int compareTo(Book other) {
    return title.compareTo(other.title);
  }
}
 No newline at end of file