I have a case in which i want my integers be 5 digitized, ex: 00001, 00011, 00100 bla bla bla.
Is there an API that re formats my integers automatically based on this format after increasing the value of the integer or i have to do it myself ?
Please advice ...
SCJP 5.0, SCWCD 1.4, SCJA 1.0
posted 9 years ago
It depends on how you are viewing the contents of the int variables. If as Strings, you could easily use substring to get an output of 5 characters by concatenating the int after some 0s: "0000"+int-value and picking off the last 5 characters.