Only else part is executed
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/513832/how-do-i-compare-strings-in-java">How do I compare strings in Java?</a>  </p>
</blockquote>



<p>even whel length is 0 and flag9 is null only else part is executed.can someone help me</p>

<pre><code>Log.d(TAG, "flag8 "+ getIntent().getExtras().getString("flag").length());
Log.d(TAG, "flag9 "+ getIntent().getExtras().getString("flag"));
if( getIntent().getExtras().getString("flag")=="0"   ||getIntent().getExtras().getString("flag").length()==0)
{
 Log.d(TAG, "hidebeta "+ getIntent().getExtras().getString("flag"));
            beta.putExtra("beta", "hidebeta");
            flag=1;
            beta.putExtra("flag", "1");
                }
else {
    beta.putExtra("beta","showbeta");
    Log.d(TAG, "showbeta "+ getIntent().getExtras().getString("flag"));
    flag=0;
    beta.putExtra("flag","0");
                }
</code></pre>
