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

Can we create our own daemon thread?

617


How many types of array are there?

628


What is the difference between length and length() method in java?

738


How does thread synchronization occurs inside a monitor? What levels of synchronization can you apply?

629


What is the base class of all exception classes?

673






What is java reflection?

627


What does the @override annotation do?

642


Difference between string, string builder, and string buffer?

616


Why do we need array in java?

617


What is method overriding in java ?

752


Is string a class in java?

604


What are the important features of Java 10 release?

618


What is user defined exception in Java?

707


What is unsigned char?

737


How does multithreading take place on a computer with a single cpu?

652