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
Is 0 true or false in java?
Can we instantiate interface in java?
What does system out println () do?
How list contains works in java?
Can we use synchronized block for primitives?
What are the Class Libraries ?
What is constructor and virtual function? Can we call a virtual function in a constructor?
What is a parameter in matrices?
What is the purpose of tostring() method in java?
which class is the wait() method defined in? : Java thread
What is the difference between the jdk 1.02 event model and the event-delegation model introduced with jdk 1.1?
Is java developer a good career?
Why you should not use singleton?
State the difference between creating string as new () and literal.
What is the purpose of file class?