Write a java program to get a string of words and print the numbers of each word count in descending order
Answer Posted / surya
public class WordCount {
public static void main(String[] args) {
String string="I got a simple solution";
String[] temp=string.split(" ");
for (int i = temp.length-1; i >=0 ; i--) {
System.out.println(temp[i]+ "-->"+temp[i].length());
}
}
}
| Is This Answer Correct ? | 0 Yes | 2 No |
Post New Answer View All Answers
what is nested class in java?
What is a dot notation?
How is a variable stored in memory?
Why is a string immutable?
Is integer immutable in java?
What is the applet security manager, and what does it provide?
What is javac used for?
What is meant by anonymous class?
Break statement can be used as labels in java?
Can we create object of inner class in java?
Where and how can you use a private constructor?
How would you dynamically allocate memory to an array?
What is the difference between array list and vector in java?
What is size_t?
Is intellij better than eclipse?