Question: PLEASE fill in all the todo lines based on inventory assignment. and I have uploaded the methods that can be used if needed. Thank you



PLEASE fill in all the todo lines based on "inventory" assignment. and I have uploaded the methods that can be used if needed.
Thank you
public class Inventory public class Inventory . 1 public class Inventory 2 // TODO :Add an Item[] instance variable called contents. // Initialize it at declaration; give it a default length of 4. 4 // Merge two inventorys, merging other into this inventory. public void merge(Inventory other) t 7 // TODO :Compute contents.length other.contents.length // TODO :Create a new Item[] of the size above // TODO Copy all the elements from contents into the new Item [ // TODO: Copy all the elements from other.contents into the new Item[l // TODO : Set contents to be the new Item[] we just filled 10 12 13 15 // Get the i-th item, where the 0th item is the first. // Return null if the index is invalid. public Item getItem(int i)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
