I'm very confused about the iterator in Java.
The tutorial is was reading said this:
In the Java programming language, an interface is a reference type, similar to a class, that can contain only constants, method signatures, and nested types. There are no method bodies. Interfaces cannot be instantiated—they can only be implemented by classes or extended by other interfaces. Extension is discussed later in this lesson.
Then I saw another tutorial with this:
Iterator<String> flavoursIter = aFlavours.iterator();
I understand that aFlavours has inheritated the iterator functions which returns the iterator interface. I just don't understand what is actually happening in this line. I thought you couldn't instantiated?
Maybe I'm not making sense, but please tell me we're I'm going off the track.