title: How to Count Repetition of Words in Array List?
body: <p>I've these code for searching occurrence in Array-List but my problem is how I can get result
  out side of this for loop in integer type cause I need in out side , may be there is another way for finding 
  occurrence with out using for loop can you help me ? 
  thank you...</p>
  
  <pre><code>List&lt;String&gt; list = new ArrayList&lt;String&gt;();
  list.add("aaa");
  list.add("bbb");
  list.add("aaa");
  
  Set&lt;String&gt; unique = new HashSet&lt;String&gt;(list);
  for (String key : unique) {
   int accurNO = Collections.frequency(list, key);
      System.out.println(key + ": " accurNO);
  }
  </code></pre>