• 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

que from dans test

 
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hello,
I came across this prob in Dans compresive test, the que was
Entries are organized as key/value pairs.
Duplicate entries replace old entries.
Which interface of the java.util package offers the specified behavior?
potions provided were
a. List
b. Map
c. Set
d. None of the above
correct ans is b
now nowhere in the API i came across - Duplicate entries replace old entries.
Does this mean is that - there is an entry A which maps to DOS a new entry
A which maps to UNIX replaces the dos entry.
So i feel that d should be the correct option.
If 'am wrong pls correct me.
Wating for a quick response.
 
Ranch Hand
Posts: 443
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by varijasmom:
now nowhere in the API i came across - Duplicate entries replace old entries.



From the MAP API:


put
public Object put(Object key,
Object value)
Associates the specified value with the specified key in this map (optional operation). If the map previously contained a mapping for this key, the old value is replaced by the specified value. (A map m is said to contain a mapping for a key k if and only if m.containsKey(k) would return true.))

 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
API continued.......
The abode method returns previous value associated with specified key, or null if there was no mapping for key...
 
Mona Gadkari
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Krishna n Alton - maybe i skipped this put method while reading the API.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic