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 java util?

978


What is final keyword in java? Give an example.

968


Difference between static binding and dynamic binding?

1047


Can we force garbage collector to run ?

1008


How does hashset work in java?

1068


Why local variables are stored in stack?

929


which one is more efficient int x; 1. if(x==null) 2.if(null==x) state which one either 1 or 2?

10991


What do you mean by constant time complexity?

1152


What is polymorphism java example?

952


What is hashing principle in java?

980


Why does java not support pointers?

1024


What is data string?

891


design an lru cache in java?

944


How do you write a conditional statement?

905


What is hash code collision?

1010