Publicis Sapient interview question

Java program to number of character occures in string?