Advertisement
Guest User

Arrays.asList is a wrapper, not a copy

a guest
Sep 2nd, 2011
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.16 KB | None | 0 0
  1. int[] a = { 1, 2, 3 };
  2. Iterator<int[]> iterator = Arrays.asList(a).iterator();
  3. iterator.next();
  4. iterator.remove(); // throws UnsupportedOperationException
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement