Question: You are to write a simple, single-class program that uses an ArrayList collection. Below is a list of the US Presidents (last name only). Write

 You are to write a simple, single-class program that uses anArrayList collection. Below is a list of the US Presidents (last name

You are to write a simple, single-class program that uses an ArrayList collection. Below is a list of the US Presidents (last name only). Write a class called PresidentList. It should have: A member (data element) which is an ArrayList of Strings; A constructor that initializes the ArrayList to the Presidents' last names (use the constructor I have provided for you below in mine, the ArrayList member is called presidents); A method to write out the list of presidents to the console window (make it as simple as possible) A method to sort the list in alphabetical order A method to return the number of names in the list A method to return the number of presidents with any specific name (so if I call it with "Jones" it will return 0, if I call it with "Bush" it will return 2)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock 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 Databases Questions!