Following setup:
int a=3;
String b="3";
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.
Is it efficient to compare these variables with this snippet,
boolean areEqual = Integer.parseInt(b) == a;
or with this one?
boolean areEqual = String.valueOf(a).equals(b);