This statement does not make sense, as far as I can see?The order of elements while iteration remains the same always.
About Question enthuware.ocpjp.v8.2.1585 :
Moderator: admin
-
- Posts: 2
- Joined: Wed Apr 06, 2016 12:54 pm
- Contact:
About Question enthuware.ocpjp.v8.2.1585 :
One of the answers to this question is:
-
- Site Admin
- Posts: 10065
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.ocpjp.v8.2.1585 :
It means that when you iterate through the elements in a HashSet, you get the elements in the same order no matter how many times you iterate. For example, if you iterate through a HashSet and if you get A, B, C first time, then if you iterate again, you will still get A, B, C. You will not get A, C, B.
This is of course incorrect (as given in the explanation) because HashSet does not guarantee this behavior.
HTH,
Paul.
This is of course incorrect (as given in the explanation) because HashSet does not guarantee this behavior.
HTH,
Paul.
If you like our products and services, please help us by posting your review here.
-
- Posts: 11
- Joined: Fri Aug 17, 2018 8:52 am
- Contact:
Re: About Question enthuware.ocpjp.v8.2.1585 :
This explanation for this question is incorrect (second choice) or confussing:
No Set (HashSet, TreeSet, or any other implementation of Set interface) allows duplicate elements.
-
- Site Admin
- Posts: 10065
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.ocpjp.v8.2.1585 :
Why do you think it is incorrect?
If you like our products and services, please help us by posting your review here.
-
- Posts: 11
- Joined: Fri Aug 17, 2018 8:52 am
- Contact:
Re: About Question enthuware.ocpjp.v8.2.1585 :
What I understand from this answear is that Set allows duplicate elements which is incorrect.
I think the correct form should be:
Set (HashSet, TreeSet, or any other implementation of Set interface) does not allow duplicate elements.
It is kind of the same but more concrete and not at all confussing
I think the correct form should be:
Set (HashSet, TreeSet, or any other implementation of Set interface) does not allow duplicate elements.
It is kind of the same but more concrete and not at all confussing
Who is online
Users browsing this forum: Bing [Bot] and 101 guests