Juicy juggling in the digital orchard

Report a typo
Hey there! This problem might be a bit unpredictable, but give it a go and let us know how you do!
Create a program that manages a fruit inventory using a List. Add three fruits, remove one, and replace another with a new fruit. Fill in the blanks in the code to complete the inventory management system and display the final contents.
Fill in the gaps with the relevant elements
<String> inventory = new <>();
inventory.("Apple");
inventory.add("Banana");
inventory.add("Orange");
String itemToRemove = "Banana";
inventory.(itemToRemove);
int indexToUpdate = 0;
inventory.(indexToUpdate, "Grapes");
System.out.println("Updated inventory: " + inventory);
VectoraddArrayListremovesetListdeleteLinkedListinsertget

Create a free account to access the full topic