Java Random String generateRandomString()

Here you can find the source of generateRandomString()

Description

Gnerate a new random string

License

Open Source License

Return

Random string

Declaration

public static String generateRandomString() 

Method Source Code

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

import java.util.Random;

public class Main {
    /**/*from  w  w w .jav a 2 s  .c  om*/
     * Gnerate a new random string
     * @return Random string
     */
    public static String generateRandomString() {
        String str = "";
        for (int i = 0; i < 10; i++)
            str += new Random().nextInt();
        return str;
    }
}

Related

  1. generateRandomStr(final int length)
  2. generateRandomStr(int length)
  3. generateRandomString()
  4. generateRandomString()
  5. generateRandomString()
  6. generateRandomString()
  7. generateRandomString()
  8. generateRandomString()
  9. generateRandomString(final int minCharLen, final int maxCharLen)