[Solved] How to find number of distinct characters in a string


With java 8 it is much easy. You could use something like this

return string.chars().distinct().count();

solved How to find number of distinct characters in a string