Java Random Number getRandomNum()

Here you can find the source of getRandomNum()

Description

get Random Num

License

Open Source License

Declaration

public static String getRandomNum() 

Method Source Code


//package com.java2s;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Random;

public class Main {

    public static String getRandomNum() {
        SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmssS");
        Date now = new Date();
        String s = sdf.format(now);
        Random rd = new Random();
        int rdNum = rd.nextInt(1000);
        String subDir = s + String.valueOf(rdNum);
        return subDir;
    }/*from   www  .  ja va 2  s .c o  m*/
}

Related

  1. getRandNum(int charCount)
  2. getRandNum(int num)
  3. getRandNum(int num)
  4. getRandNumber(int maxNumber)
  5. getRandomDouble(double max, String decimalFormat)
  6. getRandomNum()
  7. getRandomNum()
  8. getRandomNum()
  9. getRandomNum(double pSngBegin, double pSngEnd)