+ 1

Can someone please send link for random methods in java. I can't find it. Thanks

20th Aug 2018, 8:25 AM
Efe Panama
2 Answers
+ 5
import java.util.Random; Random rand = new Random(); int x = rand.nextInt(40); creates a random integer between 0 and 39, inclusive. int x = rand.nextInt(40) + 1; creates a random integer between 1 and 40, exclusive Look up the Random class, it has a whole slew of different random methods, for doubles and integers and etc...
20th Aug 2018, 10:42 AM
StealthyTaco
StealthyTaco - avatar
+ 1
20th Aug 2018, 3:40 PM
Efe Panama