Mega Code Archive

 
Categories / Java by API / Java Util
 

Random

import java.util.Random; public class Main {   public static void main(String[] args) {     Random rand = new Random();     int randomInt = rand.nextInt(10);     long randomLong = rand.nextLong() * 10;     float randomFloat = rand.nextLong() * 10;     double randomDouble = rand.nextDouble() * 10;   } }