I have to do this
INPUT:SUCCESS
OUTPUT:
C - 2
E - 1
S - 2
U - 1
I am aware this question has been asked here: How to count frequency of characters in a string?
But my query is that I need to solve the problem by only using two outside classes Scanner or StringTokenizer. I cannot use any other library.
PS:The characters have to be in alphabetical order