gistfile1.txt import java.lang.reflect.Array;import java.util.HashMap;import java.util.Scanner;public class Worda {public static void main(String[] args) {HashMap map = new HashMap();Scanner scan = new Scanner(System.in);String inputStr = s
import java.lang.reflect.Array; import java.util.HashMap; import java.util.Scanner; public class Worda { public static void main(String[] args) { HashMap map = new HashMap(); Scanner scan = new Scanner(System.in); String inputStr = scan.nextLine(); scan.close(); String[] words = inputStr.split("[^a-zA-Z]"); for(String word : words){ System.out.println(word); } for(int i = 0; i < Array.getLength(words); i++){ String temp = words[i]; if(map.containsKey(temp) == true){ Integer v = (Integer)map.get(temp); map.put(temp, v.intValue()+1); }else{ map.put(temp, 1); } } System.out.println(map); } }