subject

Given a ListItem class, complete main() using the built-in LinkedList type to create a linked list called shoppingList. The program should read items from input (ending with -1), adding each item to shoppingList, and output each item in shoppingList using the printNodeData() method. Ex. If the input is: milk bread eggs waffles cereal -1 the output is: milk bread eggs waffles cereal Current file: ShoppingList. java Load default template... 1 import java. util. Scanner; 2 import java. util. LinkedList; public class ShoppingList { public static void main (String[] args) { Scanner scnr = new Scanner(System. in); // TODO: Declare a Linkedlist called shoppingList of type ListItem String item; // TODO: Scan inputs (items) and add them to the shoppingList LinkedList // Read inputs until a -1 is input // TODO: Print the shoppingList LinkedList using the printNodeData() method 20 } File is marked as read only Current file: ListItem. java 1 public class ListItem { private String item; public ListItem() { item = ""; public ListItem(String itemInit) { this. item = itemInit; // Print this node public void printNodeData() { System. out. println(this. item);

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 00:00
Match each vocabulary word to its definition.1. desktoppicture used to represent acomputer application2. domainnetwork protectionsoftware code that can be viewed,3. iconmodified, and redistributed for freethe background screen on acomputer monitor4. url5. blogan online journalthe part of an internet address that6. firewallrefers to a group of computers on anetworkonline database of web pages7. intranetnetwork for use by an individual8. open address of a web page or9. wikiresource
Answers: 2
question
Computers and Technology, 24.06.2019 04:30
Fall protection, confined space entry procedures, controlled noise levels, and protection from chemical hazards are some of the things that contribute to a safe what
Answers: 1
question
Computers and Technology, 25.06.2019 00:00
Rom is designed for computer instructions temporary storage of data processing data
Answers: 1
question
Computers and Technology, 25.06.2019 00:30
Which of these serves as a bridge between the programming team and the audio team?
Answers: 2
You know the right answer?
Given a ListItem class, complete main() using the built-in LinkedList type to create a linked list c...
Questions
question
Mathematics, 22.01.2021 06:00
question
Mathematics, 22.01.2021 06:00
question
Mathematics, 22.01.2021 06:00
Questions on the website: 13722367