import java.util.HashMap;
import java.util.Map;
public class Test123 {
public static void main(String args[]) {
String s = "ravikiran ravikiran ravikiran";
Map<Character, Integer> charf = new HashMap<Character, Integer>();
if (s != null) {
for (Character c : s.toCharArray()) {
if(c.isSpaceChar(c)){
continue;
}
Integer count = charf.get(c);
int newCount = (count == null ? 1 : count + 1);
charf.put(c, newCount);
}
}
for (Map.Entry<Character, Integer> entry : charf.entrySet()) {
System.out.println(entry.getKey() + "/" + entry.getValue());
}
}
}
import java.util.Map;
public class Test123 {
public static void main(String args[]) {
String s = "ravikiran ravikiran ravikiran";
Map<Character, Integer> charf = new HashMap<Character, Integer>();
if (s != null) {
for (Character c : s.toCharArray()) {
if(c.isSpaceChar(c)){
continue;
}
Integer count = charf.get(c);
int newCount = (count == null ? 1 : count + 1);
charf.put(c, newCount);
}
}
for (Map.Entry<Character, Integer> entry : charf.entrySet()) {
System.out.println(entry.getKey() + "/" + entry.getValue());
}
}
}