Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- import java.util.Random;
- class HelloWorld {
- public static void main(String[] args) {
- Random rnd =new Random();
- int randomNum =rnd.nextInt(42);
- int randomNum2 =rnd.nextInt(42);
- int randomNum3 =rnd.nextInt(42);
- int randomNum4 =rnd.nextInt(42);
- int randomNum5 =rnd.nextInt(42);
- int randomNum6 =rnd.nextInt(42);
- int [] arr={randomNum,randomNum2,randomNum3,randomNum4,randomNum5,randomNum6};
- for(int index=0;index<arr.length;index++){
- System.out.println(arr[index]);
- }
- System.out.println("**********************");
- for(int item:arr){
- System.out.println(item);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement