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

iphone - Three second countdown in cocos2d -

hyperlink - how to do url routing in php -

c - Avoiding Extra Malloc in Linked List (node->next = NULL) -