I want to create a iterator in my program,
Node list = new Node();
Iterator it = list.iterator();
//iterate over all the objects in the list
Object obj = it.next();
//do something with that object
But when I compile the program it gives me an error (cannot resolve symbol)with list.iterator();
should the method iterator() should be defined what it is?, if so can you give a example on what it should contain and how it will look like return types etc...