Each time I see the word 'ordered' I immediately think 'sorted' which I know is wrong. Here it means maintaining insertion order.
Can it be assumed that any mention of 'ordered' when referring to collections always means 'insertion order' and not 'sorted order'?
Thanks.
About Question enthuware.ocpjp.v7.2.1594 :
Moderator: admin
-
- Posts: 5
- Joined: Wed Apr 17, 2013 2:41 pm
- Contact:
-
- Site Admin
- Posts: 10053
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.ocpjp.v7.2.1594 :
Yes, order always means insertion order in Java collections terminology unless explicitly stated otherwise.
HTH,
Paul.
HTH,
Paul.
If you like our products and services, please help us by posting your review here.
-
- Posts: 6
- Joined: Tue Nov 22, 2016 11:04 am
- Contact:
Re: About Question enthuware.ocpjp.v7.2.1594 :
Related to this question:
Thanks!
The ordered only means List implementation? It cannot be a queue?ordered means you need a class that implements List
Thanks!
-
- Site Admin
- Posts: 10053
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.ocpjp.v7.2.1594 :
A Queue does keep the elements in order but that order is not necessarily the order in which the elements are inserted in the queue (as is required in the question). For example, a PriorityQueue may keep elements in order of the priority of the elements.
If you like our products and services, please help us by posting your review here.
Who is online
Users browsing this forum: No registered users and 60 guests