packageimport java.util.Random;

public class Test
{
    public static void main ( String[] args )
    {
        Random random = new Random();
        System.out.println(random.nextInt(99999)); //随机生成 5位数字的编码   并且不能重复
      

      /*String eString = Integer.toString(random.nextInt(99999));
       if (eString.length() >= 5) {
       System.out.println(eString); //随机生成 5位数字的编码 并且不能重复
       }*/


} }

 

posted on 2018-04-20 15:25  WWonder  阅读(2637)  评论(1编辑  收藏  举报