limit input to 4 numbers ranging from 0001-9999
808490Oct 26 2010 — edited Oct 29 2010Hello helpful Java friends,
I am trying to limit the user to enter in an ID number that is 4 ints long and has leading zeros. So if the user enter 2 the code will make it 0002. The user also has to enter only ints. I am thinking it is a try catch but am not sure how to do it so far. Any help would be great. Thank you!!
-Brian