Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

What is the importance of hashcode() and equals() methods?

1090


What are instance variables?

1125


What is the super void?

954


What is difference between throw and throws ?

1202


What is the exact difference in between Unicast and Multicast object? Where will it be used?

1103


What are the types of strings?

1089


How can you make sure that your singleton class will always return single instance in multi-threaded environment?

1084


What is the purpose of using the java bean?

1102


Is there any way to skip finally block of exception even if some exception occurs in the exception block?

1115


How to implement an arraylist in java?

1251


Which method cannot be overridden in java?

1039


Compare overloading and overriding?

1056


Explain the transient field modifier?

1087


Does garbage collection occur in permanent generation space in jvm?

1139


Tell us something about set interface.

1065