Random String Generator Using Java

This is a simple method to create a random string result, the first method is create string between A-Z and 0-9 while the second one only provide hexadecimal characters.

package com.edw.main;

import java.util.UUID;
import org.apache.commons.lang.RandomStringUtils;

public class Main {
    public static void main(String[] args) {
        // one
        // two
        System.out.println(UUID.randomUUID().toString().replace("-", "").toUpperCase());

This is the screenshot of my Netbeans Project.

and this is the result,

Hope it helped others, good luck.

No Comments

Leave a Comment

Please be polite. We appreciate that.
Your email address will not be published and required fields are marked