Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int[] arr = {10, 20, 30, 40, 50, 60, 70};
- Random rnd = new Random();
- for(int i = 0; i < arr.length; i++) {
- int index = rnd.nextInt(i + 1);
- int a = arr[index];
- arr[index] = arr[i];
- arr[i] = a;
- }
Add Comment
Please, Sign In to add comment