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

Answers were Sorted based on User's Feedback



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

Answer / 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

More Core Java Interview Questions

What is the difference between reader/writer and inputstream/output stream?

0 Answers  


Explain importance of inheritance in java?

0 Answers  


What lambda means?

0 Answers  


What are the fileinputstream and fileoutputstream?

0 Answers  


How do you implement singleton class?

0 Answers  


What is the null?

0 Answers  


What is slash r?

0 Answers  


String Reverse in Java...!

5 Answers  


What do u mean by wrapper Class? What do u mean by Jvm... How do u change JVM for other OS? Or No need to Change ...? its like tricky

6 Answers   Accenture, EDS,


What is polymorphism in java? What are the kinds of polymorphism?

0 Answers  


What classes of exceptions may be caught by a catch clause in java programming?

0 Answers  


What best practices should you follow while writing multithreaded code in java?

0 Answers  


Categories