Java: String.equalsIgnoreCase(. . .) not working
<p>I am developing a small application in Java. The following if condition never becomes true, does any body be knows the actual reason?</p>

<pre><code>public int foo()
{

String sTitle = "title";
if (sTitle.equalsIgnoreCase(MyCustomObject.sTitle))
    return 5;
else
    return 6;
}
</code></pre>

<p>It always returns 6. I ran it in debug mode and saw that both strings contains same value.
I also tried swapping the positions of both strings like:</p>

<pre><code>MyCustomObject.sTitle.equalsIgnoreCase(sTitle)
</code></pre>

<p>but that didn't work either.</p>
