No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.
[code]public Product findProduct(Product searchProduct) { Product found = null; for(Product item : stock) { if(item.id == searchProduct.id) {found=item; break; } } return found; }[/code] The error code reads: id has private access in Product. I am new at this and do not know how to write it correctly. Thank you, … | |
Re:
the program draws lines, but every time I draw a new line, the previous one disappears. How can I let it show all the lines drawn? I know my problem is in the array, but how to fix it? thanks for help [code] import javax.swing.JPanel; import java.awt.*; import java.awt.event.*; import … |