Code example for Random

Methods: nextInt

0
import java.util.Random; 
 
public class IdGenerator { 
  private static Random rand = new Random(); 
  public static String getId() {
    return String.valueOf(System.currentTimeMillis() + System.nanoTime() + rand.nextInt());    
  } 
} 
Contextual code suggestions in your IDE  Get Codota for Java