Link to home
Start Free TrialLog in
Avatar of tia_kamakshi
tia_kamakshiFlag for United Arab Emirates

asked on

Creating 5 digit integer value

Hi I am working in Java

I have to create min 5 digit integer value that should start with 1

for example 1 should be 00001
2 should be 00002 etc

00001
00002
...
...
99999
100000
100001
100002
...
...

and if we have a list of above values, I also need to find the earliest no from the list

Please help me with this logic

Many Thanks
ASKER CERTIFIED SOLUTION
Avatar of ksivananth
ksivananth
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
You can create the numbers stirngs(not integers) by prepending the required number of 'Zeros'.
Avatar of tia_kamakshi

ASKER

Many Thanks. It works great