- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
final double base = 10.0;
final int minCode = (int)Math.pow(base, CODE_LENGTH - 1) - 1;
final int maxCode = (int)Math.pow(base, CODE_LENGTH) - 1;
while (true)
{
final int code = codeGenerator.nextInt();
if ((code > minCode) && (code <= maxCode))
{
return String.valueOf(code);
}
}