About Question enthuware.ocpjp.v7.2.1594 :

Help and support on OCA OCP Java Programmer Certification Questions
1Z0-808, 1Z0-809, 1Z0-815, 1Z0-816, 1Z0-817

Moderator: admin

Post Reply
emj211
Posts: 5
Joined: Wed Apr 17, 2013 2:41 pm
Contact:

About Question enthuware.ocpjp.v7.2.1594 :

Post by emj211 »

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.

admin
Site Admin
Posts: 10046
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

Re: About Question enthuware.ocpjp.v7.2.1594 :

Post by admin »

Yes, order always means insertion order in Java collections terminology unless explicitly stated otherwise.

HTH,
Paul.
If you like our products and services, please help us by posting your review here.

phusztek
Posts: 6
Joined: Tue Nov 22, 2016 11:04 am
Contact:

Re: About Question enthuware.ocpjp.v7.2.1594 :

Post by phusztek »

Related to this question:
ordered means you need a class that implements List
The ordered only means List implementation? It cannot be a queue?

Thanks!

admin
Site Admin
Posts: 10046
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

Re: About Question enthuware.ocpjp.v7.2.1594 :

Post by admin »

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.

Post Reply

Who is online

Users browsing this forum: No registered users and 68 guests