-1
我想有2D鏈表數組爲:二維鏈表數組
private LinkedList<Integer>[] adjLst;
graph(int n){
noOfNodes = n-1;
for(int i=0;i<=noOfNodes;i++){
adjLst[i] = new LinkedList<Integer>();
}
}
但是,當我從我的主類調用它爲:
graph g =new graph(13);
它拋出一個NullPointerException異常?