Answer to Question #274909 in Java | JSP | JSF for Evan

Question #274909

Take your Array of InventoryItems from assignment 11 and add a ItemID as an Integer and change the test data in the program to have them. (This would be like an ID in a database and would be a number like 452 or 535. It wouldn’t be anything about the data in that object. It gives us another integer value to work with.) Make sure the test data doesn’t have the 5 InventoryItem ItemIDs in order yet at the start.



1
Expert's answer
2021-12-03T00:37:33-0500
public class InventoryItem {
    private int itemID;

    public InventoryItem(int itemID) {
        this.itemID = itemID;
    }
}


public class Main {
    public static void main(String[] args) {
        InventoryItem item1 = new InventoryItem(1);
        InventoryItem item2 = new InventoryItem(2);
        InventoryItem item3 = new InventoryItem(3);
    }
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS