Guest User

Untitled

a guest
Feb 25th, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. package CharacterStatistic;
  2.  
  3. import java.util.Map;
  4. import java.util.Scanner;
  5.  
  6. public class CoreStatistic {
  7.  
  8. public static void main(String[] arg) {
  9. System.out.println("Print your string:");
  10. Scanner str = new Scanner(System.in);
  11. String newStr = str.nextLine();
  12.  
  13. if (newStr.isEmpty()) {
  14. System.out.println("Empty string");
  15. return;
  16. }
  17.  
  18. newStr = newStr.toLowerCase().replace(" ", "");
  19. Statistic statistic = new Statistic();
  20. Map<Character, Integer> stat = statistic.Calc(newStr);
  21. statistic.WriteStatistic(stat);
  22. }
  23. }
Add Comment
Please, Sign In to add comment