Any Idea how I generate random Char values in Java? I'm creating a random password generator -


this question has answer here:

i'm creating random password generator in java , need how can generate random char values in program. ideas? i'm using menu system way show different types of passwords generate lowercase, uppercase, etc.

any advice help.

thanks!

random r = new random();  string alphabet = "123xyz";  // prints 50 random characters alphabet (int = 0; < 50; i++)  {     system.out.println(alphabet.charat(r.nextint(alphabet.length()))); }  

instead of printing chars, add them stringbuilder, , have random password.

(source)


Comments

Popular posts from this blog

java.util.scanner - How to read and add only numbers to array from a text file -

rewrite - Trouble with Wordpress multiple custom querystrings -