compare two numeric String values

Integer.parseInt("4") == Integer.parseInt("04")

That is it. You can convert a numeric string into integer using Integer.parseInt(String) method, which returns an int type. And then comparison is same as 4 == 4.

Leave a Comment