subject

Consider the following client class:import java. util. Collection;import java. util. Collections;import java. util. HashMap;import java. util. Map;import java. util. Set;public class PresidentsMain { public static void main(String[] args) { Map = new HashMap(); .put("George Washington", "Unaffiliated"); .put("John Adams", "Federalist"); .put("Thomas Jefferson", "Democratic-Republican"); .put("James Madison", "Democratic-Republican"); .put("James Monroe", "Democratic-Republican"); .put("John Quincy Adams", "Democratic-Republican"); .put("Andrew Jackson", "Democratic"); .put("Martin Van Buren", "Democratic"); .put("William Henry Harrison", "Whig"); .put("John Tyler", "Whig"); } }}Extend given client class:Implement a static method called FilterMapByValue, that takes 2 parameters:Map InMap;String TargetValue;Method should print out all map elements, for which Value == TargetValue. Test the implementation by filtering map so that only presidents, affiliated with Democratic-Republican party are printed. Note: use the following to iterate over a map: for (Map. Entry Entry : InMap. entrySet()) Implement a method PrintValues, that prints all values for a given map (use map’s values() function). Test the implementation on map. Implement a method PrintKeys, that prints all keys for a given map (use map’s keySet() function). Test the implementation on map.

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 24.06.2019 12:50
When is it most apprpriate for a development team to change the definition of done
Answers: 1
question
Computers and Technology, 24.06.2019 13:20
In the insert table dialog box, you select the checkbox to create the first row as the header of the table.
Answers: 3
question
Computers and Technology, 24.06.2019 17:00
What are some examples of what can be changed through options available in the font dialog box? check all that apply. font family italicizing bolding pasting drop shadow cutting character spacing special symbols
Answers: 2
question
Computers and Technology, 24.06.2019 18:30
These factors limit the ability to attach files to e-mail messages. location of sender recipient's ability to open file size of file type of operating system used
Answers: 1
You know the right answer?
Consider the following client class:import java. util. Collection;import java. util. Collections;imp...
Questions
question
Health, 23.07.2021 01:00
question
Chemistry, 23.07.2021 01:00
question
Chemistry, 23.07.2021 01:00
Questions on the website: 13722363