Do some experimenting by changing what the LineItem class's toString() method returns. Some combination of variables and Strings should give you what you want.
I'm done for tonight.
Type: Posts; User: Norm
Do some experimenting by changing what the LineItem class's toString() method returns. Some combination of variables and Strings should give you what you want.
I'm done for tonight.
Look at post #6 again. Especially the hint.
That means that the first value you added has been lost. If you create a new array every time you add an item, all the items in the previous array are lost. Make sure you create the array one time...
I updated my last post. The output for 1 product looked ok.
Can you give me the responses I need to make to test the code? Just what I type in.
I tried this:
1
soup
2.39
1
3
My IDE does not support an active console so I put the responses in a...
How do you compile the code you have posted? The compiler needs to know what package a class is in so it can find its definition. The import statement names the package a class is in so the...
What variable has the null value that is being printed? Then backtrack in the code to find out why that variable does not have a valid value.
Produt: Product: Butter Price: $1.29 Price:...
Yes, empty slots in an array would have null values. The code should keep track of how many slots in the array are used or test if they have null values before trying to use them.
The posted...
Where are the Strings coming from that have the null values? Start at the the println() statement that printed the null and back track in the code to see where the null value is coming from.
The...