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

Can we use catch statement for checked exceptions?

0 Answers  


What is a wrapper method?

0 Answers  


What are three advantages of using functions?

0 Answers  


Write a program that takes a 5 digit number and calculates 2 power that number and prints it.

1 Answers  


How do you join strings in java?

0 Answers  


How do you convert string to int in java?

0 Answers  


What does a method signature consist of?

0 Answers  


What methods are used to get and set the text label displayed by a button object?

0 Answers  


how to handle exceptions in ejb?

1 Answers   HCL,


What is a qualifier in a sentence?

0 Answers  


What is volatile keyword in java

0 Answers  


If two threads have same priority which thread will be executed first ?

0 Answers  


Categories