Guest User

Untitled

a guest
Jul 16th, 2018
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.21 KB | None | 0 0
  1. int[] arr = {10, 20, 30, 40, 50, 60, 70};
  2.  
  3. Random rnd = new Random();
  4. for(int i = 0; i < arr.length; i++) {
  5. int index = rnd.nextInt(i + 1);
  6. int a = arr[index];
  7. arr[index] = arr[i];
  8. arr[i] = a;
  9. }
Add Comment
Please, Sign In to add comment