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, 22.06.2019 19:30
When using a public computer or network, you should always
Answers: 2
question
Computers and Technology, 23.06.2019 17:20
What is the best assassins creed game?
Answers: 2
question
Computers and Technology, 24.06.2019 01:30
Hazel has just finished adding pictures to her holiday newsletter. she decides to crop an image. what is cropping an image?
Answers: 1
question
Computers and Technology, 24.06.2019 10:00
(, urgent need): how do i change my username
Answers: 1
You know the right answer?
Consider the following client class:import java. util. Collection;import java. util. Collections;imp...
Questions
question
Geography, 29.06.2021 20:50
question
Mathematics, 29.06.2021 20:50