title: Comparing string array to a character array
body: <pre><code>String[] dictionaryArr= new String[]{&quot;mee&quot;,&quot;go&quot;,&quot;bat&quot;,&quot;me&quot;,&quot;eat&quot;,&quot;goal&quot;,&quot;boy&quot;,&quot;run&quot;,&quot;go&quot;};
  
  char[] characterArr={'e','o','b','a','m','g','l'};
  </code></pre>
  <p>OR</p>
  <pre><code>String[] characterArr= new String[]{&quot;e&quot;,&quot;o&quot;,&quot;b&quot;,&quot;a&quot;,&quot;m&quot;,&quot;g&quot;,&quot;l&quot;};
  </code></pre>
  <p>I want to compare dictionaryArr to characterArr in such a way that it will</p>
  <p><strong>output: go, me, goal</strong></p>
  <p><strong>Note: it did'nt output &quot;mee&quot; because letter &quot;e&quot; is repeated and there is only one 'e' in characterArr also it shouldn't print &quot;go&quot; twice</strong></p>
  <p>Here's what I have so far:</p>
  <pre><code>for (int i = 0; i &lt; dictionaryArr.length ; i++) {
      for (int j = 0; j &lt; characterArr.length ; j++) {
          if (dictionaryArr[i] == characterArr[j]) {
              System.out.println(dictionaryArr[i]);
          }
      }
  }
  </code></pre>