Count words in array of string in java
<p>Greeting everyone.
I am studying java myself.Now I am learning about array and I wanted to make some program count words. The xersice provides me: <code>String myWords = {"soon; hi; also; soon; job; also"};</code>
and I have to create method like <code>countWrods(myWords);</code> 
The printed result should be the words print out order as in a dictionary and also the number of unique words and total words. 
I am looking for help to guide me right way and same time teach me something. 
here is my code: </p>

<pre><code>public class Words {
    public static  void main(String[] args){    
        String[] myWords = {"soon; hi; also; soon; job; mother; job; also; soon; later"};
        Words myW= new Words();
        myW.countWords();
        System.out.println("\tWords   \tFreq");
    }
    public  static String[] countWords(myWords){
        for (int i=0; i&lt;myWords.length; i++){
        String temp = myWords[i];
        //System.out.println(temp + " ");
        for(int j=i+1; j&lt;myWords.length; j++){
        String temp2= myWords[j];

            System.out.println("No. of unique words: " );
        }
        }
    }
}
</code></pre>

<p>WHat should I do next.</p>
