I have following string in my java class
String str="0000000000008";
Now I want to increment that so that the next value should be 0000000000009
For that purpose, I tried to cast this String str into Integer
Integer i=Integer.parseFloat(str)+1;
and when I print the value of i it prints only 17(as it removes the leading 0's from string at the time of cast).
How can I increment the String value, so that the leading 0's will remain, and the series will continue?