0
* Inserts a new value in the list after the given Node. For example,
* if the list is 1,2,3,4, and listNode is 2 then addAfter(listNode,9) should give
* 1,2,9,3,4.
* @param listNode the new value should be inserted after this node
* @param t the value to insert
* @return the newly created Node
*/
public Node<T> addAfter(Node<T> listNode, T t)
{
Node<T> newNode =new Node<T>(t, listNode, listNode.next);
newNode.next=listNode.next;
listNode.next=newNode;
newNode.prev=listNode;
size++;
return newNode;
}
나는 또한 NullPointerException
오류가 발생합니다.
어떻게 해결할 수 있습니까?