FastFoodCoding

Login


Connect with one of the following accounts





Login

Please wait while we redirect...

Views: 319   



This program shows you how to generate random number in Java



import java.util.Random;

public class RandomNumber {
    public static void main(String[] args) {

        Random random = new Random();
        System.out.println("Random Numbers between 0 & 10: " + random.nextInt(10));
        System.out.println("Random Numbers between 0 & 100: " + random.nextInt(100));

    }

}

Output:

Random Numbers between 0 & 10: 4
Random Numbers between 0 & 100: 36



On By


Top Tutorials

Top Questions

Top Articles

Top Blogs

Top News