hi programmer,
I am writing a double link list. when I try to insert an item, it gives me an null pointer error when I try to run it. this is what I basically did, in the list class,
I declared GroceryItemNode newItem = new GroceryItemNode();
then I used this new object to call another class to set the values.
I put newItem.setItem(something);
then, newItem.getItem().setDescription(decription);
can somebody how to solve this null pointer error?
thank you!!(can you also put some example on the reply?)
I am writing a double link list. when I try to insert an item, it gives me an null pointer error when I try to run it. this is what I basically did, in the list class,
I declared GroceryItemNode newItem = new GroceryItemNode();
then I used this new object to call another class to set the values.
I put newItem.setItem(something);
then, newItem.getItem().setDescription(decription);
can somebody how to solve this null pointer error?
thank you!!(can you also put some example on the reply?)