• 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

Difference betwwen Sorted and Ordered

 
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

Somebody please explain to me or direct me to somewhere I can understand how Sorted and Ordered are different.

Thanks!
 
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Jaspreet,

I found on net regarding difference between sort and order.

sort: To arrange (things, etc.) according to a kind or quality, or
after some settled order or system; to separate and put into
different sorts or classes.

order: The action of putting or keeping in order.

in order: In proper sequence or succession, according to rank,
importance, seniority, size, position, date, affinity, etc.
 
Ranch Hand
Posts: 110
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ordered : when a collection is ordered it means you can iterate through the collection in a specific order. An ArrayList is ordered by index.

Sorted : when a collection contains objects that are organized according to some rules. A TreeSet is a sorted collection because its elements are organized in ascending order(it has nothing to do with what position it was added at)
reply
    Bookmark Topic Watch Topic
  • New Topic