Question: Write a program that creates two ArrayListsone to hold Strings and one to hold Integers. Prompt the user for a word, and while the user

Write a program that creates two ArrayLists—one to hold Strings and one to hold Integers. Prompt the user for a word, and while the user does not enter a sentinel value, continue to add each entered word to the ArrayList, sort the list, pass the list to a display() method, and prompt for another word. After the user enters the sentinel value, prompt the user for an integer. While the user does not enter the sentinel value, continue to add each entered Integer to the ArrayList, sort the list, pass the list to the same display() method, and then prompt the user for another Integer. Save the program as DisplaySortedLists.java.

Step by Step Solution

3.33 Rating (156 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

import javautil public class DisplaySortedLists public static void mainString args Arr... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Java Programming Questions!