LinkedList « iterator « Java Collection Q&A

Home
Java Collection Q&A
1.algorithm
2.array
3.Array Byte
4.Array Char
5.Array Convert
6.Array Dimension
7.Array Integer
8.Array Object
9.Array String
10.ArrayList
11.collection
12.comparator
13.Development
14.Garbage Collection
15.Generic
16.hash
17.HashMap
18.HashTable
19.iterator
20.LinkedList
21.List
22.Map
23.queue
24.Set
25.Sort
26.tree
Java Collection Q&A » iterator » LinkedList 

1. Making your Own Linked Lists N' Iterators.    forums.oracle.com

STLinkedList.java:91: cannot find symbol symbol : class iterator location: class STLinkedList public iterator Iterator() ^ STLinkedList.java:3: STLinkedList is not abstract and does not override abstract method iterator() in java.lang.Iterable public class STLinkedList implements Iterable The second of the first pair of error messages is telling you that class STLinkedList must have a method called iterator(). Look up the API documentation for ...

2. overwriting next() for an iterator problem with linked lists    forums.oracle.com

private class MyIterator implements Iterator{ private int moddy, headCount = 0; private Node index = head.prev; public MyIterator() { moddy = modCount; //index = head.prev; } public boolean hasNext() { if(moddy!=modCount){ throw new ConcurrentModificationException("This list has been modified"); } if(index.next != null && headCount < 1){ if(index.next == head){ headCount++; } return true;

java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.