标签:style class blog code java http
// 生成订单号 public static String setRandomChar() { String str = ""; for (int i = 0; i < 10; i++) { int ch = (int) (10 * (Math.random())); str = str + ch; } return str; } // 生成优惠券号 前四位大写字母 后六位数字 public static String genCouponCode() { String str = ""; for (int i = 0; i < 4; i++) { int ch = ((int)‘A‘)+ (int) (26 * (Math.random())); str = str +(char)ch; } for (int i = 0; i < 6; i++) { int ch = (int) (10 * (Math.random())); str = str + ch; } return str; }
生成订单号 、生成优惠券号 前四位大写字母 后六位数字,布布扣,bubuko.com
标签:style class blog code java http
原文地址:http://www.cnblogs.com/W203654/p/3772752.html