K
Ken
Hi. I noticed that the iterator interface says that remove() is
optional. I have an ArrayList Iterator that I'm getting, then passing
around to clients through the Iterator interface. The goal is to not
have clients care whether I have a LinkedList, ArrayList, etc. My
concern is that I don't want to allow remove() to be available through
the iterator. However, when I call "iterator" on the list, the
iterator I get allows "remove" to be called. How do I "disable" this
method?
Thanks!
Ken
optional. I have an ArrayList Iterator that I'm getting, then passing
around to clients through the Iterator interface. The goal is to not
have clients care whether I have a LinkedList, ArrayList, etc. My
concern is that I don't want to allow remove() to be available through
the iterator. However, when I call "iterator" on the list, the
iterator I get allows "remove" to be called. How do I "disable" this
method?
Thanks!
Ken