티스토리 뷰

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++;

}

}


}


공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
«   2025/07   »
1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31
글 보관함