写了一个类似的,看看能不能帮你吧,类似功能!
import java.util.Random;
public class RandomE
{
 public static void main(String[] args)
 {
  Random select=new Random();
  
  //更改数字可以选择随机出现的字符串长度
  int letterNum=10+select.nextInt(20);
  int nowletter=0;
  char nowlet=' ';
  StringBuffer target=new StringBuffer(50);  for(int i=0;i<letterNum;)
  {
   //这里更改数字可以决定出现的字符是出现在什么字符之间
   nowletter=select.nextInt(128);
   if(nowletter >60)
    {
     nowlet=(char)nowletter;
     target.append(nowlet);
     i++;
    }
   else
     {
      continue;
     }
   }
   System.out.println(target);
  }
}