package com.santhosh.random;
import java.util.Random;
import org.apache.commons.lang3.StringUtils;
public class SequenceGenerator {
private final Random random;
public SequenceGenerator() {
random = new Random();
}
/**
* Returns a pseudo-random integer between 0 and n-1.
*
* @see Random#nextInt(int)
*/
public int nextInt(int n) {
return random.nextInt(n);
}
public static void main(String[] args) {
SequenceGenerator g = new SequenceGenerator();
String result = StringUtils.leftPad(String.valueOf(g.nextInt(99999)),
5, '0');
System.out.println(result);
}
}