Java Random Int getRandom(int c)

Here you can find the source of getRandom(int c)

Description

get Random

License

Open Source License

Declaration

public static String getRandom(int c) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

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

public class Main {
    public static String getRandom(int c) {
        Random r = new Random();
        SimpleDateFormat format = new SimpleDateFormat("ssSSS");
        Date d = new Date();
        StringBuffer sb = new StringBuffer();
        // for(int i = 0; i < c; i ++){
        sb.append(format.format(d));/*from w  w  w  .  j  a v a2  s.  com*/
        sb.append(r.nextInt(10));
        // }
        //// System.out.println(sb.toString());
        // return sb.toString().substring(1,7);
        return sb.toString();
    }
}

Related

  1. generateRandomTargetId(final String uniqueId, final int count)
  2. getIntRandom(int i)
  3. getIntRandomReqId()
  4. getIntRandomValue(int paramInt)
  5. getPositiveInt()
  6. getRandomInt()
  7. getRandomInt()
  8. getRandomInt()
  9. getRandomInt()