Java Program to Generate Random Numbers

By Editorial Staff in Java Programming. Updated on


In this post, I will explain about a Java program to generate random numbers with an example and program output.

This is a very basic program in Java programming language. If you are Java beginners or want to start learning Java programming language, then this program will help you to understand the basic Java programming.

Java Program to Generate Random Numbers

Java Program to Generate Random Numbers

Before executing this program I assume you have configured Java in your computer. Copy the below program and create a file “GenerateRandomNumber.java” and execute it to generate random numbers.

Program Output

Please enter maximum range: 200
167
61
89
179
68
116
145
124
54
198

Sharing is caring!


Editorial Staff

Editorial Staff at FreeWebMentor is a team of professional developers leads by Prem Tiwari

You might also like:

Tags: , , , , , , ,

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.