Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

T implements comparable

public static class Node<T extends Comparable<T>> { //HERE

    private T value;

    public Node(T val) {
        this.value = val;
    }

    public void insert(T val) {
        if (value.compareTo(val) > 0) {
            new Node<T>(val);
        }
    }
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #T #implements #comparable
ADD COMMENT
Topic
Name
3+3 =