Write a java program to get a string of words and print the numbers of each word count in descending order
Answer Posted / hema talele
package com;
public class StringChar {
/**
* @param Hema.talele
*/
public static void main(String[] args) {
String str = "HemaLovesMilind";
System.out.println(str);
for(int i= str.length(); i>0 ; i--)
{
System.out.println("char="+str.charAt(i-1));
System.out.println("index of
letter="+str.indexOf(str.charAt(i-1)));
System.out.println("simple count"+i);
System.out.println(str.charAt(i-1)+"="+i);
}
}
}
Is This Answer Correct ? | 24 Yes | 26 No |
Post New Answer View All Answers
What is the difference between array and array list in java?
What is a jagged array in java?
What is the function of http?
What is the difference between static (class) method and instance method?
What is an class?
When a thread is executing a synchronized method , then is it possible for the same thread to access other synchronized methods of an object ?
how to create multithreaded program? Explain different ways of using thread? When a thread is created and started, what is its initial state? : Java thread
Difference between static synchronization vs. Instance synchronization?
Is a boolean variable?
What is an array in java?
What is unicode in java?
What is an escape character in java?
What is difference between iterator and enumeration in java?
What are the types of relation?
how to write a program for sending mails between client and server