gistfile1.txt import java.util.HashMap;import java.util.Scanner;public class Chars {public static void main(String[] args) {Scanner scan = new Scanner(System.in);String inputStr = scan.nextLine();char[] chrs = inputStr.toCharArray();HashMap
import java.util.HashMap; import java.util.Scanner; public class Chars { public static void main(String[] args) { Scanner scan = new Scanner(System.in); String inputStr = scan.nextLine(); char[] chrs = inputStr.toCharArray(); HashMap map = new HashMap(); for(char temp : chrs){ if(map.containsKey(temp)){ Integer v = (Integer)map.get(temp); map.put(temp, v+1); }else{ map.put(temp, 1); } } System.out.println(map); } }