Java Random Name getRandomName()

Here you can find the source of getRandomName()

Description

get Random Name

License

Open Source License

Declaration

public static String getRandomName() 

Method Source Code


//package com.java2s;
import java.text.DateFormat;

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

public class Main {

    public static String getRandomName() {
        DateFormat format = new SimpleDateFormat("yyMMddHHmmss");
        String formatDate = format.format(new Date());
        int random = new Random().nextInt(10000);
        return formatDate + random;
    }//from   w  w w. ja  va  2 s  . c  o m
}

Related

  1. getRandomFileName()
  2. getRandomName()
  3. getRandomName()
  4. randomFilename()
  5. randomFileName()
  6. randomIndexName()
  7. randomName()