Create a Java program to count the frequency of each character in a given string using HashMap.
Learning goals:
- Practice HashMap
- Learn key-value pair operations
- Understand frequency counting pattern
- Improve problem solving for interview questions
Example:
Input: programming
Output:
p = 1
r = 2
o = 1
g = 2
a = 1
m = 2
i = 1
n = 1
Create a Java program to count the frequency of each character in a given string using HashMap.
Learning goals:
Example:
Input: programming
Output:
p = 1
r = 2
o = 1
g = 2
a = 1
m = 2
i = 1
n = 1