• 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

doubtful collection framework

 
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
the answer seems to be wrong
if a classes should not be duplicated, ordered, and no special
search facility which of the following will u use.
a.list
b.set
c.map
d.collection
answer = d, but I think it should be b.
list is ordered, rejected
map dont allow duplicates but search is fast, rejected
collection is not a class, rejected
left out is set
 
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
List, Set, Map, and Collection are all interfaces. So you can't reject Collection based on whether or not it's a class.
I think the question is worded poorly and should specify what interface you would implement, but the concepts are the same.
The question also seems be be ambiguous because it seems to be saying that each element should be unique, the elements should not be ordered, and no special search facility is needed.
From that, I would say a set would qualify unless a set by nature has a special search facility?
But the question could also be meaning that the elements should ordered and unique, with no special search facilities necessary.
In this case, one would need a collection and impose their own contraints on it to achieve that effect (using the options given in the question).
What was the explanation of the author of your question?
April
 
We should throw him a surprise party. It will cheer him up. We can use this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic