kim george wrote:
Campbell Ritchie wrote:Surely the return type for the method should be Set<EOHoverFrog> rather than HashSet<etc>?
kim george wrote:i got the error message "java.util.set is abstract; cannot be instantiated"
kim george wrote:aah ok, so now I've got
No, it's not necessary. One is irrelevant, as you were told here. I told you about [] earlier.kim george wrote: . . . is it necessary to have twice? Is it doing something different each time or is one of them irrelevent?
If you open the website and write a reply, the previous posts are not updated. So I often find myself repeating what somebody else said, because I didn't realise it had been said while I had the page open.kim george wrote:oops there seems to be a delay in your posts arriving, I didn't see the last couple before I posted sorry!
You're welcomekim george wrote:and yes I see what you mean about [] thanks . . .
SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6 - OCEJPAD 6
How To Ask Questions How To Answer Questions
Rob Spoor wrote:If you just need an empty Set, List, Collection or Map, java.util.Collections has methods for returning those (emptySet, emptyList, etc). And the good thing about these is that they are shared objects - not one instance for each empty whatever you need, but the same one over and over again.
Pat Farrell wrote:
Rob Spoor wrote:If you just need an empty Set, List, Collection or Map, java.util.Collections has methods for returning those (emptySet, emptyList, etc). And the good thing about these is that they are shared objects - not one instance for each empty whatever you need, but the same one over and over again.
These are immutable, which is good. But they are not generic. The Guava equivalents are generic.
SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6 - OCEJPAD 6
How To Ask Questions How To Answer Questions
Consider Paul's rocket mass heater. |