public class FindFreq{
public static void main(String...s){
String para="hello hello this is a mis mistake r u r u ready to solve this ";
char parachar[]=para.toCharArray();
int first=0,last=0,index=0;
String[] wordArray=new String[20];
for(int i=0;i<parachar.length-1;i++){
char temp='a';
String tempWord="";
first=i;
while(temp!=' '){
temp=parachar[i];
i++;
}
last=--i;
for(int j=first;j<last;j++){
tempWord=tempWord+parachar[j];
}
wordArray[index]=tempWord;
index++;
}
for(int i=0;i<wordArray.length;i++){
int fre=0;
for(int j=0;j<wordArray.length;j++){
if(wordArray[i]==wordArray[j])
fre++;
}
System.out.println(wordArray[i]+" Frequency="+fre);
}
}
}