Replace multiple occurrences of a character
Maybe I am wrong but I prefers to use the regex for this kind of text manipulation.
Here is my code, 

System.out.println("hhiii!!!  hooowww   aaareee   yyyooou???"
                      .replaceAll("(.)\\1+","$1"));