Cara menguji berapa banyak satu karakter dalam string java
int count = string.length() - string.replaceAll("g","").length()
Obedient Ox
int count = string.length() - string.replaceAll("g","").length()