我在Java中实现了一个四元链接列表作为Node对象的矩阵,我将其作为内部类实现:
public class Test {
private Node[][] Matrix;
class Node {
int data;
Node up;
Node down;
Node left;
Node right;
}
public Test() {
Matrix = new Node[10][10];
for (int col = 0; col < 10; col++) {
for (int row = 0; row < 10; row++) {
Matrix[row][col] = new Node();
}
}
}
public static void main(String[] args) {
Test test = new Test();
}
}
首先,这是正确/最好的方法吗?其次,尽管运行正常但是当我逐行调试时,我会在前进到行Test(Object).<init>() line: 37 [local variables unavailable]
之前得到错误Source not found
和Matrix = new Node[10][10];
窗口。它然后卡在那一行并给我一个ClassNotFound异常:
owns: Object (id=28)
owns: Object (id=29)
ClassNotFoundException(Throwable).<init>(String, Throwable) line: 286
ClassNotFoundException(Exception).<init>(String, Throwable) line: not available
ClassNotFoundException(ReflectiveOperationException).<init>(String, Throwable) line: not available
ClassNotFoundException.<init>(String) line: not available
URLClassLoader$1.run() line: not available
URLClassLoader$1.run() line: not available
AccessController.doPrivileged(PrivilegedExceptionAction<T>, AccessControlContext) line: not available [native method]
Launcher$ExtClassLoader(URLClassLoader).findClass(String) line: not available
Launcher$ExtClassLoader(ClassLoader).loadClass(String, boolean) line: not available
Launcher$AppClassLoader(ClassLoader).loadClass(String, boolean) line: not available
Launcher$AppClassLoader.loadClass(String, boolean) line: not available
Launcher$AppClassLoader(ClassLoader).loadClass(String) line: not available
为什么会这样?
谢谢!