方法中的变量不能分配给值

时间:2014-03-26 15:15:03

标签: java pointers

我想为变量"指针"赋值。但它总是得到一个null。 我打开调试器来观察变量,表明g.adjList[i].firstedge不是空的。这是怎么发生的?

ps:firstedge属于EdgeNode。

public static void showAll(Graph g) {
      for (int i = 1;i<= g.numVertexs ; i++) {    
        EdgeNode pointer = g.adjList[i].firstedge;
        while(pointer != null) {
            //....
            pointer = pointer.next;
        }
   }
}

0 个答案:

没有答案
相关问题