Generate Random Numbers using Java

The following Java code generates random numbers.
  1. import java.util.*;  
  2. import java.util.Scanner;  
  3. class Random   
  4. {  
  5.     public static void main(String[] args)   
  6.     {  
  7.         int count, num, range;  
  8.         Scanner input = new Scanner(System. in );  
  9.         System.out.print("Enter how many random numbers you want: ");  
  10.         num = input.nextInt();  
  11.         System.out.print("Enter the max range of random number: ");  
  12.         range = input.nextInt();  
  13.         Random rnum = new Random();  
  14.         /* Below code would generate 5 random numbers 
  15.          * between 0 and 200. 
  16.          */  
  17.         System.out.println(+num + " Random Numbers between 0 to " + range + " are as following:" + "\n");  
  18.         for (count = 1; count <= num; count++)   
  19.         {  
  20.             System.out.println(rnum.nextInt(range));  
  21.         }  
  22.     }  
  23. }  
Thank you, keep learning and sharing