Advertisement
CR7CR7

rrr

Dec 3rd, 2022
549
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.80 KB | None | 0 0
  1. import java.util.Scanner;
  2. import java.util.Random;
  3. class HelloWorld {
  4.     public static void main(String[] args) {
  5.         Random rnd =new Random();
  6.         int randomNum =rnd.nextInt(42);
  7.          int randomNum2 =rnd.nextInt(42);
  8.           int randomNum3 =rnd.nextInt(42);
  9.            int randomNum4 =rnd.nextInt(42);
  10.             int randomNum5 =rnd.nextInt(42);
  11.             int randomNum6 =rnd.nextInt(42);
  12.             int [] arr={randomNum,randomNum2,randomNum3,randomNum4,randomNum5,randomNum6};
  13.             for(int index=0;index<arr.length;index++){
  14.              System.out.println(arr[index]);
  15.             }
  16.             System.out.println("**********************");
  17.             for(int item:arr){
  18.                 System.out.println(item);
  19.                
  20.             }
  21.        
  22.     }
  23. }
  24.  
  25.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement