Java: Why does this code give me a "general array creation error"?

Why does the following code result in a “generic array generation” error at compile time?

public class Trie<Value> {
    private class Node {
        private Node[] links = new Node[256];
        private Object val;
    }
}

Error message: Trie.java:3: error: generic array creation 
        private Node[] links = new Node[256];
+4
source share

Source: https://habr.com/ru/post/1682002/


All Articles