I have to create a bank account with some requirements, in the middle of them I need to have a constant number of 5 digits started from 00001.
But putting "00001" at the time of display only displays 2, 3 onwards. my solution was to use the number 10000. But I wanted to know how to do it according to the statement.
public abstract class Account implements IBaseRate {
String name;
String sSN;
double balence;
String accountNumber;
double rate;
static int index = 00001;
...
private String setAccountNumber() {
String lastSSN = sSN.substring(sSN.length()-2, sSN.length());
int uniqueID = index++;
int randomNumber = (int) (Math.random()*Math.pow(10, 3));
return lastSSN + uniqueID + randomNumber;
}
}