Выдает такую вот ошибку web-валидатор!!!
java.lang.NullPointerException
at com.javarush.task.task10.task1019.Solution.main(Solution.java:16)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
package com.javarush.task.task10.task1019;
import java.io.*;
import java.util.HashMap;
import java.util.Map;
/*
Функциональности маловато!
*/
public class Solution {
public static void main(String[] args) throws IOException {
Map<String, Integer> maplist = new HashMap<>();
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
while (true) {
String s = reader.readLine();
if (s.isEmpty()) break;
int id = Integer.parseInt(s);
String name = reader.readLine();
maplist.put(name, id);
}
for (Map.Entry<String, Integer> pair : maplist.entrySet()) {
System.out.println(pair.getValue() + " " + pair.getKey());
}
}
}