I have figured it out....
apparently, the problem was with the looping statement that used variable b and what stock[b] was pointing to. I changed the statement to say this...
...
Type: Posts; User: amgleason83
I have figured it out....
apparently, the problem was with the looping statement that used variable b and what stock[b] was pointing to. I changed the statement to say this...
...
yes, i printed...
stock[a].getItemName()
stock[a].itemname
stock[b].getItemName()
stock[b.itemname
temp.getItemName()
temp.itemname
compare
I have printed the values stored in stock[a], stock[b], temp, and compare just to make sure that everything was returning a value, not only did they all return a value, but the correct value as well....
ok, I changed it up a bit trying to get this right. I am still getting the null value error message though. Please help me understand how I should go about printing those values in the correct spot...
Ok, so I added this for loop at the beginning of the final else statement to display the output. It should compare the strings from each entry in the array. However, I am getting an error message...
I am trying to sort the 'stock' array (which is made up of Product objects) by the item name of each Product object. Before I start hacking at my code (which works well right now), I want to know if...
can anyone tell me why the "stop" command does not work?
package payroll;
import java.util.Scanner;
public class Payroll { ...
I cannot seem to understand why after the first round of input, the loop continues before the name variable is entered the second time. After the loops completes once, I get this output:
Enter...
I am glad to finally have some help! lol