How to Generate a Random Number in Java
In this tutorial, we will going to create a program that generates a random number using Java. We will just use the Math.random() function which returns a random number between 0.0 and 1.0
Now let's start this tutorial!
1. Open JCreator or NetBeans and make a java program with a file name of randomNumber.java.
2. Import javax.swing package.