Hi,

This is ravi i have a question like this i have string
"UNDERSTAND" now i want to count the letters how many times
it occures.i.e from the above string the out put should be
like this U-1,N-2,D-2,E-1,R-1,S-1,T-1,A-1.
how can i achieve this

Thnaks in advance for your response ..

Answer Posted / dilip

Actually what i think is take integers from a-z and
initialize each with 0



then take the string & using charAt & equalsIgnoreCase
increment the respaective values & then print the same.....

Is This Answer Correct ?    0 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is meant by object?

583


Can a method inside a interface be declared as final?

534


Is set sorted in java?

523


Do loops java?

559


Why are the methods of the math class static?

593






How do you reverse a word in java?

533


What is the function of http?

535


what do you mean by classloader?

555


How to read and write image from a file ?

561


What is data type example?

556


What is difference between class and object in java?

533


Explain, java is compatible with all servers but not all browsers?

617


What is the reflection?

565


When will you define a method as static in Java?

576


How do you use equal in java?

546