I want to change the string input to character but when I run the code error occurs "Exception in thread "main" java.lang.NumberFormatException: For input string: "" ".
Map<Integer, Character> c = new HashMap<Integer, Character>();
Scanner sa = new Scanner(System.in);
for (int i = 0; i <3 ; i++) {
System.out.println("Enter key");
Integer a = sa.nextInt();
System.out.println("Enter value");
char d = (char) Integer.parseInt(sa.nextLine());
c.put(a,d);
}
System.out.println(c);