(List<String> a)
| 55 | i = it.previousIndex(); |
| 56 | } |
| 57 | public static void iterManipulation(List<String> a) { |
| 58 | ListIterator<String> it = a.listIterator(); |
| 59 | it.add("47"); |
| 60 | // Must move to an element after add(): |
| 61 | it.next(); |
| 62 | // Remove the element after the new one: |
| 63 | it.remove(); |
| 64 | // Must move to an element after remove(): |
| 65 | it.next(); |
| 66 | // Change the element after the deleted one: |
| 67 | it.set("47"); |
| 68 | } |
| 69 | public static void testVisual(List<String> a) { |
| 70 | System.out.println(a); |
| 71 | List<String> b = LIST; |