Tagged Questions
45
votes
4answers
1k views
Why were Java collections implemented with “optional methods” in the interface?
During my first implementation extending the Java collection framework, I was quite surprised to see that the collection interface contains methods declared as optional. The implementer is expected ...
4
votes
3answers
469 views
What should I name these methods?
I have two interfaces, one with and one without generic type parameters. The non-generic interface is used internally so that I can store instances of the generic interface in a collection. All would ...
9
votes
6answers
2k views
Are Java's public fields just a tragic historical design flaw at this point?
It seems to be Java orthodoxy at this point that one should basically never use public fields for object state. (I don't necessarily agree, but that's not relevant to my question.) Given that, would ...