title: Is it More Efficient to Convert String to Int or Int to String When Checking for Equality?
body: <p>Following setup:</p>
  
  <pre><code>int a=3;
  String b="3";
  </code></pre>
  
  <p>Both variables represent IDs which are semantically equal. Since the application is for the mobile device, it is very important that the comparison of these variables is done in the most efficient way possible.</p>
  
  <p>Is it efficient to compare these variables with this snippet,</p>
  
  <pre><code>boolean areEqual = Integer.parseInt(b) == a;
  </code></pre>
  
  <p>or with this one?</p>
  
  <pre><code>boolean areEqual = String.valueOf(a).equals(b);
  </code></pre>