0512随机4位验证码
package com.text_1; import java.util.Random; public class yanzhengma { public static void main(String[] args) { // TODO 自动生成的方法存根 //随机4位验证码 Random num=new Random(); int arr[]=new int[2]; Random zimu=new Random(); String str="abcdefghijklmnopqistuvwxyz"; int arr1[]=new int[2]; for (int i=0;i<2;i++) { arr[i]=num.nextInt(10); System.out.print(arr[i]); arr1[i]=zimu.nextInt(26); System.out.print(str.substring(arr[i], arr[i]+1)); } } }