How do I multiply 10 to an
object and get back the
I am looking for the neatest way of doing this.
I would probably do it this way:
Get int from
object, multiply it with the other int and create another Integer object with this int value.
Code will be something like ...
integerObj = new Integer(integerObj.intValue() * 10);
But, I saw a code where the author is doing it this way: Get the
object, concatenate "0" at the end and then get
object back by using
The code is something like this:
String s = integerObj + "0";
integerObj = Integer.parseInt(s);
Is there any merit in doing it either way?
And what would be the most efficient/neatest way in general and in this case?