This week only. Pastebin PRO Accounts Christmas Special! Don't miss out!Want more features on Pastebin? Sign Up, it's FREE!
Guest

Arrays.asList is a wrapper, not a copy

By: a guest on Sep 2nd, 2011  |  syntax: Java  |  size: 0.16 KB  |  views: 58  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. int[] a = { 1, 2, 3 };
  2. Iterator<int[]> iterator = Arrays.asList(a).iterator();
  3. iterator.next();
  4. iterator.remove(); // throws UnsupportedOperationException
clone this paste RAW Paste Data