How to get the value inside the if condition?
<p>I am comparing strings in if condition and printing the value of selectedradbtn inside the if condition. Here the <strong>selectedradbtn</strong> is printing inside the if condition...but when I am printing before if condition the value is printing...</p>

<p>My code:</p>

<pre><code> ArrayList&lt;String&gt; array2;
static int selectedradbtn;


selectedradbtn = Previouspage.selectedradiobtn;
System.out.println("selected radio button outside if"+selectedradbtn); //here value is printing
if(Integer.toString(selectedradbtn).equals(array2.get(0)) &amp;&amp; array2.get(3).equals("1") )
{
   System.out.println("selected radio button in if"+selectedradbtn); //value not printing
   correct = correct+ 1;
   System.out.println("correct if"+correct);
}
</code></pre>

<p>Where I am going wrong...please help me regarding this...
Thanks in advance...</p>
