Write a java program to get a string of words and print the numbers of each word count in descending order
Answer Posted / karthick
package com.subex.exm;
/**
* Author-Hema
* => Program that prints the nos. of each word count of
String in Descending order!!!
*/
public class subexExp {
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);
System.out.println(s.charAt(i-1));
}
}
}
| Is This Answer Correct ? | 2 Yes | 7 No |
Post New Answer View All Answers
Explain the polymorphism principle?
Do we need to manually write Copy Constructor?
What is array size in java?
Explain importance of inheritance in java?
What is string literal in java?
What does sprintf return?
Which is the best sorting technique in java?
Can inner class final?
What is the order of arraylist in java?
What is an example of a conditional statement?
Is it possible to write a regular expression to check if string is a number?
What is the primary benefit of encapsulation?
What is the difference between length and length () in java?
Explain the difference between hashmap and hashtable in java?
What does it mean that a method or field is “static”?