There Should Be Space Wed Feb 12 20:54:57 MST 2020 There should be space where nothing makes sense and that’s okay with everyone. There should be a place where absolutely nothing matters, and we don’t have a clue what’s going on, but again it doesn’t matter…so we survive. Things like that. Isn’t that okay? Isn’t that what this life should be about? Something like that.
Here's how we generate a random number in Java. It's quite simple. First we import java.util.Random. Then we call that class and grab the next int with an upper bound of 25. That is to say we pick a number from zero to twenty-five. It cannot go below zero it cannot go above twenty-five.
import java.util.Random;
public class RandomNumber {
public static void main(String[] args) {
Random rand = new Random();
int int_random = rand.nextInt(25);
System.out.println(int_random);
}
}
Comments
Post a Comment