Search:

Type: Posts; User: andbin

Search: Search took 0.14 seconds.

  1. Replies
    6
    Views
    871

    Re: Help with sorting Employee class

    In a very sketchy way:


    public class Book implements Comparable<Book> {
    private String title;
    private String publisher;

    // ... constructor(s), getter/setter methods, toString(),...
  2. Replies
    6
    Views
    871

    Re: Help with sorting Employee class

    Comparable must be implemented into the class of the objects to sort, so you can have only 1 ordering with Comparable for a given type, that should be the "natural" ordering of the objects (the order...
Results 1 to 2 of 2