📜  T 实现可比较 - Java 代码示例

📅  最后修改于: 2022-03-11 14:52:14.332000             🧑  作者: Mango

代码示例1
public static class Node> { //HERE

    private T value;

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

    public void insert(T val) {
        if (value.compareTo(val) > 0) {
            new Node(val);
        }
    }
}