Well, since you already have Book as Comparable, the List.indexOf(Object o) method might work.
(Might work, not sure)
Say you wanted to search for a Book with the title: "Java"
Since your...
Type: Posts; User: aussiemcgr
Well, since you already have Book as Comparable, the List.indexOf(Object o) method might work.
(Might work, not sure)
Say you wanted to search for a Book with the title: "Java"
Since your...
Here is a possibility:
The compareTo method is supposed to return a -1,0,or 1. However, in your compareTo method, you only return a 0 and a 1. I do not know if it will make a difference, but it is...
That is incorrect. There are two sort methods in the Collections API:
1:
2:
Now, there are two different classes that have similar names. 1 is the Comparable Class and the other is the...
I haven't used Comparable extensively, but I'll provide what help I can.
The line where you are sorting is this, correct:
Collections.sort(temp);
If so, you seem to be attempting to use...