Dimenticare

Random strings

Jan 3rd, 2013
353
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.34 KB | None | 0 0
  1. import java.util.Random;
  2. public class strings {
  3.     public static void main(String[] agrs){
  4.         Random r=new Random();
  5.         char[] set={'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'};
  6.         for (int i=0; i<40; i++){
  7.             System.out.print(set[r.nextInt(26)]);
  8.         }
  9.     }
  10. }
Advertisement
Add Comment
Please, Sign In to add comment