langsung saja pada source nya :
public class CodeRandom {
public CodeRandom(){
Random r = new Random();
int wordLength = 5 ;
StringBuilder sb = new StringBuilder(wordLength);
for(int i = 0; i < wordLength; i++) {
char tmp = (char) ('a' + r.nextInt('z' - 'a'));
sb.append(tmp);
}
System.out.println(sb.toString());
}
}
SELAMAT MENCOBA !!!
0 comments:
Post a Comment