• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Concurrent Collections

 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think I know the difference between ordered and sorted.

I think, ordered means the order in which elements are put in the collection is maintained, preserved ...

I think sorted means the order in which the elements are presented or the real order in the way the are in the collection, which means most of the time, a natural order, like alphabetical or numbered ascending ...

So, how can a concurrent collection be ordered as well as sorted ?  (like table 7.9, page 360 in the OCP book)

Thanks for an answer in advance.

 
author
Posts: 23951
142
jQuery Eclipse IDE Firefox Browser VI Editor C++ Chrome Java Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Roland Lensink wrote:
So, how can a concurrent collection be ordered as well as sorted ?  (like table 7.9, page 360 in the OCP book)



All sorted collections are ordered -- as the order is the sort order. The reverse is not true though, as ordered does not necessarily mean sorted. In your example, insertion order is not a sort order.

So, any collection that is sorted, is "ordered as well as sorted".

Henry
reply
    Bookmark Topic Watch Topic
  • New Topic