Mega Code Archive

 
Categories / Java / Development Class
 

Math random

/** Demonstrate the easy way of getting random numbers,  * using java.lang.Math.Random().  */ public class Random1 {   public static void main(String[] argv) {     //+     // java.lang.Math.random() is static, don't need to construct Math     System.out.println("A random from java.lang.Math is " + Math.random());     //-   } }