Bellow is a class for Binary search tree.
class BinarySearchTree <T extends Comparable<T>> implements Iterable<T> {
private Node<T> root;
public void add(T data) {
Node<T> p = new Node<T>(data);
if (root == null) {
root = p;
} else {
root.addNode(p);
}
}
Why is the Comparable extended instead of implemented? for example
class BinarySearchTree <T> implements Iterable<T>, Comperable <T>