If you are adding a Song
to ImmutableBinaryTree
song must satisfy the bounds of the type parameter on ImmutableBinaryTree
, meaning it must implement the Comparable
interface since the type parameter specifies the bounds T extends Comparable<T>
.
public class Song implements Comparable<Song>{
@Override
public int compareTo(Song arg0) {
//provide implementation here
//See effective java for appropriate implementation conditions
return 0;
}
}