How do I represent numbers in the format
001 = 1 002 = 2 003 = 3 010 = 10 020 = 20
The number of digits is always 3.
Integer.valueOf("020") is sufficient for your purpose. It will give you 20 as a result. After that you can use it as Integer, int or String.
Integer.valueOf("020")
Integer
int
String