Equality test for numeric value input parameter received as String data type
<p>I am receiving a numeric value input parameter that is a String data type (something that I cannot change) and I need to check that this value received is of a certain number. I.e. Check if the value is 5.</p>

<p>Knowing that the received value of String data type, but at all times it will should contain only numbers. I would first convert the value into an integer data type, and then perform the equality test. I.e. Case B illustrated below.</p>

<p>Case A:</p>

<pre><code>String expected = "3"; 

if(expected.equals(actual)) //...
</code></pre>

<p>Case B:</p>

<pre><code>int expected = 3;

int actualInt = Integer.parseInt(actual);

if(expected == actualInt) //...
</code></pre>

<p>I would like to find out if there will be any cons in performing the equality test using Case B as I am more inclined to do it that way as a correct way out.</p>
