package com.codegym.task.task08.task0821;
import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;
/*
Shared last names and first names
*/
public class Solution {
public static void main(String[] args) {
Map<String, String> map = createPeopleList();
printPeopleList(map);
}
public static Map<String, String> createPeopleList() {
//write your code here
Map<String, String> people = new HashMap<String, String>();
people.put("Aaa", "Brian");
people.put("Bbb", "Casey");
people.put("Ccc", "Tyler");
people.put("Ddd", "Justin");
people.put("Eee", "Mitch");
people.put("Fff", "Tyler");
people.put("Ggg", "Tom");
people.put("Hhh", "Nick");
people.put("Iii", "Matt");
people.put("Jjj", "Tyler");
people.put("Aaa", "Lucas");
return people;
}
public static void printPeopleList(Map<String, String> map) {
for (Map.Entry<String, String> s : map.entrySet()) {
System.out.println(s.getKey() + " " + s.getValue());
}
}
}
package com.codegym.task.task08.task0821;
import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;
/*
Shared last names and first names
*/
public class Solution {
public static void main(String[] args) {
Map<String, String> map = createPeopleList();
printPeopleList(map);
}
public static Map<String, String> createPeopleList() {
//write your code here
Map<String, String> people = new HashMap<String, String>();
people.put("Aaa", "Brian");
people.put("Bbb", "Casey");
people.put("Ccc", "Tyler");
people.put("Ddd", "Justin");
people.put("Eee", "Mitch");
people.put("Fff", "Tyler");
people.put("Ggg", "Tom");
people.put("Hhh", "Nick");
people.put("Iii", "Matt");
people.put("Jjj", "Tyler");
people.put("Aaa", "Lucas");
return people;
}
public static void printPeopleList(Map<String, String> map) {
for (Map.Entry<String, String> s : map.entrySet()) {
System.out.println(s.getKey() + " " + s.getValue());
}
}
}