package coupon;


import java.util.Random;


public class Coupon {


public static void main(String[] args) {


int couponSize = 1000;

final char[] possibleCharacters =

{'1', '2', '3', '4', '5', '6', '7', '8', '9', '0', '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'};

final int possibleCharacterCount = possibleCharacters.length;


String[] arr = new String[couponSize];


Random rnd = new Random();

int currentIndex = 0;

int i = 0;

while (currentIndex < couponSize) {

StringBuffer buf = new StringBuffer(16);

for (i= 16; i > 0; i--) {

buf.append(possibleCharacters[rnd.nextInt(possibleCharacterCount)]);

}


String password = buf.toString();

System.out.println("password==>"+password);


arr[currentIndex] = password;

currentIndex++;

}

}


}


Posted by [czar]
,