Hint 3 on random numbers for Lab 2 (Fall 2024)

03 Sep 2024 - 18:21 | Version 1 |
Here is program that will print a random integer between 0 and 10:
import java.io.*;
import java.util.*;
public class RandomDemo {
    public static void main(String[] args) {
        Random generator;
        int number;

        generator = new Random();
        number =  generator.nextInt(10);
        System.out.println(number);
    }
}
This site is powered by FoswikiCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding Foswiki? Send feedback
This website is using cookies. More info. That's Fine