import java.util.*;
public class GenSN
{
Random objRandom;
public GenSN()
{
long seed = Calendar.getInstance().getTimeInMillis();
objRandom = new Random(seed);
}
private char genChar()
{
int iRand = objRandom.nextInt(36);
if(iRand<=9)
return (char) (iRand +48);
else
return (char) (iRand +55);
}
public static void main(String args[])
{
System.out.print("序列号: ");
GenSN obj = new GenSN();
for(int i = 1;i<24;i++)
{
if (i%6!=0)
System.out.print( obj.genChar() );
else
System.out.print("-");
}
System.out.println();
}
}