• 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

Snychronied access for hashmaps

 
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
What does this statement means. It is from Applied Reasoning Java Ceritification Mock Exam:
Hashmaps provide synchronized access through synchronized wrappers.
What is meant by synchronized access and synchronized wrapper.
Thanks
Muhammad Ali
 
Ranch Hand
Posts: 2120
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Synchronized access means that not more than one thread is able to access the container at the same time.
Sybchronized wrappers refers to the objects returned by these kind of methods:
Collections.synchronizedCollection( new TreeSet() );
Collections.synchronizedMap( new HashMap() );
Collections.synchronizedList( new ArrayList() );
etc.
They are in java.util.Collections and return an object that wraps the Collection/Map passed as argument and makes them synchronized.
Consult the API for the way to use them.
 
reply
    Bookmark Topic Watch Topic
  • New Topic