Write a java program to get a string of words and print the numbers of each word count in descending order

Answer Posted / hema

package sampleques;
/**
* Author-Hema
* => Program that prints the nos. of each word count of
String in Descending order!!!
*/


public class CountStringWords {
public static void main(String[] args) {
String s="HemaLovesMilind";
System.out.println(s);
for(int i=s.length();i>0;i--)
{
System.out.println(i );
}
}
}

Is This Answer Correct ?    20 Yes 23 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Is 0 true or false in java?

515


Can we instantiate interface in java?

666


What does system out println () do?

551


How list contains works in java?

548


Can we use synchronized block for primitives?

595






What are the Class Libraries ?

587


What is constructor and virtual function? Can we call a virtual function in a constructor?

674


What is a parameter in matrices?

539


What is the purpose of tostring() method in java?

545


which class is the wait() method defined in? : Java thread

519


What is the difference between the jdk 1.02 event model and the event-delegation model introduced with jdk 1.1?

606


Is java developer a good career?

548


Why you should not use singleton?

534


State the difference between creating string as new () and literal.

517


What is the purpose of file class?

539