Did you print this: stock[b].getItemName()
it returns a reference that is used to access the compare...To() method
Type: Posts; User: Norm
Did you print this: stock[b].getItemName()
it returns a reference that is used to access the compare...To() method
You need to find the variable with the null value.
Add a println just in front of the line where the NPE occurs. Print the values of all the variables.
Which variable in that statement has a null value?
Print out the values of all the variables in that line to see which variable has a null value. Then try to find out why it does not have a valid...
Write a sort method that Compares the itemName members when making the decision on how to order the elements in the array.