title: Comparing elements from 2 string arrays in java
body: <p>I have 2 String arrays say A and B.
  both contains some strings. I want to compare array A with B to find the elements which are exist in both arrays.....</p>
  
  <pre><code>String[] a=new String[] {"alpha","beta"};
  String[] b=new String[] {"alpha","beta","gamma","xxxx","yyyy"};
  </code></pre>
  
  <p>the result which I needed is alpha and beta...</p>