Suggest a feature
×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: Java
Posted by: user97340
Added: Feb 28, 2018 7:34 AM
Views: 12
Tags: no tags
  1. public static final String upper = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
  2.  
  3.     public static String nextString() {
  4.         String s = "";
  5.         for (int i = 0; i < new java.util.Random().nextInt(10);++i){
  6.             s += upper.charAt(new java.util.Random().nextInt(26));
  7.         }
  8.  
  9.         return s;
  10.     }