Computers and Technology

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.

answer
Answers: 2

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 01:00, ariyanna029
What is added to the < meta > tag to describe the encoding type?
Answers: 2
image
Computers and Technology, 22.06.2019 18:00, crimhill
When is it appropriate to use an absolute reference
Answers: 1
image
Computers and Technology, 23.06.2019 03:50, dondre54
Q-1 which of the following can exist as cloud-based it resources? a. physical serverb. virtual serverc. software programd. network device
Answers: 1
image
Computers and Technology, 23.06.2019 16:10, alexis9658
What is the ooh? a. omaha occupation handbook b. online occupational c. occupations online d. occupational outlook handbook select the best answer from the choices provided
Answers: 3
Do you know the correct answer?
Consider the following client class:import java. util. Collection;import java. util. Collections;imp...

Questions in other subjects: