22 lines
640 B
Java
22 lines
640 B
Java
import java.io.*;
|
|
import java.util.HashMap;
|
|
import java.util.Map;
|
|
|
|
public class Task3 {
|
|
public static void main(String[] arguments) throws IOException {
|
|
var friends = new HashMap<String, Integer>();
|
|
|
|
friends.put("Maximilian Mayer", 20);
|
|
friends.put("Emil Faber", 30);
|
|
friends.put("Anna Müller", 45);
|
|
friends.put("Sebastian Waller", 39);
|
|
friends.put("Oliver Stilz", 25);
|
|
|
|
for (Map.Entry<String, Integer> name: friends.entrySet()) {
|
|
System.out.print(name.getKey());
|
|
System.out.print(": ");
|
|
System.out.println(name.getValue());
|
|
}
|
|
}
|
|
}
|