How to count duplicate character in a string using Java.

Published --