Net-informations.com
SiteMap  | About    

Getting random numbers in Java

In Java 1.7 or later, the standard way to do this is as follows:

min: minimum value

max: maximum value

Example

Above code return a long value between 50 (inclusive) and 101 (exclusive)

Before Java 1.7 , the standard way to do this is as follows:

Example

Above code return the value between 1 minimum and 100 is the maximum









net-informations.com (C) 2017    Founded by raps mk
All Rights Reserved. All other trademarks are property of their respective owners.