Oracle Community Directory
Oracle Community FAQ
My Oracle Support Community (MOSC)
Go Directly To
Oracle Technology Network Community
My Oracle Support Community
OPN Cloud Connection
Oracle Employee Community
Oracle User Group Community
OTN Speaker Bureau
Other Topics [ARCHIVE]
Please enter a title.
You can not post a blank message. Please type your message and try again.
This discussion is archived
: Jun 1, 2012 2:19 AM by
Query regarding implementation of HashSet and TreeSet and AbstractSet
Jun 1, 2012 2:03 AM
I have found that the treeSet and HashSet extends AbstractSet and implements Cloneable and Serializable interfaces.
What happens if AbstractSet itself implements Cloneable and Serializable interfaces, so that The HashSet and TreeSet need not to implement separately?
Is it a design concern or is there any logic behind in doing so?
I appreciate your quick response..
This content has been marked as final.
Show 1 reply
Re: Query regarding implementation of HashSet and TreeSet and AbstractSet
Jun 1, 2012 2:19 AM
in response to
It would mean that anybody else such as me who extended AbstractSet would be stuck with my implementation being serializable and cloneable whether I wanted or not. No doubt the designers wanted to provide the freedom not to do so.