I get the following error when trying to create an array of Nodes:
Exception in thread "main" java.lang.ClassCastException: [Ljava.lang.Object; cannot be cast to [LSkipList$Node;
This is my code:
public class Node {
Key key;
Value val;
Node[] next;
//constructor
public Node(Key k, Value v) {
key = k;
val = v;
next = (Node[])new Object[MAX_LEVEL];
}
}