System.out.println( Math.random() ); --> numbers ranging from 0.0 to 1.0 (double)
System.out.println( Math.random() * 3); --> numbers ranging from 0.0 to 3.0 (double)
System.out.println( (int)(Math.random()*10) + 2); --> numbers ranging from 2 to 10 (int)
Comments
Leave a comment