Java program to generate random numbers: This code generates random numbers in range 0 to 100 (both inclusive).
Java programming code
Download Random Numbers program class file.
Output of program:
nextInt(c) method returns next integer in 0 to c (both inclusive), c must be positive. To generate random float's use nextFloat which returns float between 0.0 to 1.0.
No comments:
Post a Comment