1 2 3 4 5 6 7 8 9 10 11 12 13 |
import java.util.Random; class RandNum{ public static void main(String args[]){ Random newRandom = new Random(); for(int i=0;i<10;i++) System.out.println(newRandom.nextInt()); } } |
Output
1 2 3 4 5 6 7 8 9 10 |
259615430 603747155 856122138 636480740 1731918604 1479987343 2051756868 -1012661989 -173830469 1638839759 |
Discussion
— Your output will be Different.
For More details Visit : https://docs.oracle.com/javase/9/docs/api/java/util/Random.html