Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

generate random letters and numbers in java

import java.util.Random;

public class Generator {
	public static String generateRandomPassword(int len) {
		String chars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijk"
          +"lmnopqrstuvwxyz!@#$%&";
		Random rnd = new Random();
		StringBuilder sb = new StringBuilder(len);
		for (int i = 0; i < len; i++)
			sb.append(chars.charAt(rnd.nextInt(chars.length())));
		return sb.toString();
	}
}
Comment

PREVIOUS NEXT
Code Example
Java :: bukkit event list 
Java :: android studio centering textview in relativelayout 
Java :: spigot spawn entity 
Java :: list to int array in java 8 
Java :: listview get selected java 
Java :: jackson ignore null 
Java :: array to map java 
Java :: calculate prime factors of a number java 
Java :: Json web token dependency in Maven 
Java :: android hide soft keyboard 
Java :: how to measure the running time of a code section in java? 
Java :: foreground java jframe 
Java :: how to check if location is enabled android 
Java :: init cap java 
Java :: how to make plugin wait spigot 
Java :: jaxb exclude field 
Java :: android gridlayout equal column width 
Java :: java stream collect to string 
Java :: finally block does not complete normallyJava(536871096) 
Java :: java method to capitalize first letter 
Java :: how to set lowered bezels in jlabel 
Java :: zpool 
Java :: default night mode not working 
Java :: plus one 
Java :: android studio constrainglayout 
Java :: change an image in imageview java 
Java :: list java processes 
Java :: java intercept ctrl c 
Java :: android studio java random number generator 
Java :: add oracle jdbc driver to eclipse java project 
ADD CONTENT
Topic
Content
Source link
Name
6+7 =