title: How to count words in array of strings in java?
body: <p>I am learning about arrays and I wanted to make a program count words. Given: <code>String myWords = {"soon; hi; also; soon; job; also"};</code>
  , I have to create a method like <code>countWrods(myWords);</code> 
  The printed result should be the words printed alphabetical order, the number of unique words and total words. 
  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>