why is string matching not working? : <pre><code> String [] P = K.split(" ");
//NB: the value of K is "malaria zika AIDS"

 for (int x=0;x&lt; P.length; x++) 
   {
       if (P[x]=="zika") 
          { 
            System.out.println( "This is zika virus P[x]="+ P[x]); 
               }else{
           System.out.println( "This is NOT zika virus P[x]="+P[x]); 
          }
   }
</code></pre>

<h2>Expecting</h2>

<pre><code>This is NOT zika virus P[x]=Malaria
This is zika virus P[x]=zika
This is NOT zika virus P[x]=AIDS
</code></pre>

<h2>But Getting</h2>

<pre><code>This is NOT zika virus P[x]=Malaria
This is NOT zika virus P[x]=zika
This is NOT zika virus P[x]=AIDS
</code></pre>

<p>What am I missing? I believe that this is the part with the problem. <code>if (P[x]=="zika")</code></p>
