There are many ways of converting a String to an Integer object. Which is the most efficient among the below:
Integer.valueOf() Integer.parseInt() org.apache
If efficiency is your concern, use int: it is much faster than Integer.
Otherwise, class Integer offers you at least a couple clear, clean ways:
Integer myInteger = new Integer(someString); Integer anotherInteger = Integer.valueOf(someOtherString);