java abstract class
I'm reading a book about data structures in java, and it's talking about iterators now. I saw the following code and it seems odd to me. In the following code, `AbstractIterator` is an abstract class that implements `Iterator<E>`, `UniqueFilter`is a subclass of `AbstractIterator` that is not abstract, and `data` is a Vector. I guess I don't understand how in the first line you can take the output of the Vector.iterator() method and cast that into an abstract class. After line 1, is `dataIterator` not an instantiated instance of an abstract class?

    AbstractIterator<String> dataIterator =
        (AbstractIterator<String>)data.iterator();
    AbstractIterator<String> ui = new UniqueFilter(dataIterator);


java abstract class
===

I'm reading a book about data structures in java, and it's talking about iterators now. I saw the following code and it seems odd to me. In the following code, `AbstractIterator` is an abstract class that implements `Iterator<E>`, `UniqueFilter`is a subclass of `AbstractIterator` that is not abstract, and `data` is a Vector. I guess I don't understand how in the first line you can take the output of the Vector.iterator() method and cast that into an abstract class. After line 1, is `dataIterator` not an instantiated instance of an abstract class?

    AbstractIterator<String> dataIterator =
        (AbstractIterator<String>)data.iterator();
    AbstractIterator<String> ui = new UniqueFilter(dataIterator);

