Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9246471
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T09:29:49+00:00 2026-06-18T09:29:49+00:00

I am reading Javadoc for LinkedHashMap , where it is mentioned: The putAll method

  • 0

I am reading Javadoc for LinkedHashMap, where it is mentioned:

The putAll method generates one entry access for each mapping in the
specified map, in the order that key-value mappings are provided by
the specified map’s entry set iterator.

My question is, what does it mean “one entry access for each mapping”. It would be appreciated if anyone could help to provide an example to clarify this.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T09:29:51+00:00Added an answer on June 18, 2026 at 9:29 am

    This paragraph applies to maps created with the special constructor that makes the iteration order based on last access order (vs. insertion order for a standard LinkedHashMap.

    It simply says that if a key K is in the map and you call putAll(someOtherMap) where someOtherMap contains K too, this will be considered as an access to K and it will be moved to the end of the map (from an iteration order’s perspective).

    In other words, from an access perspective, putAll is equivalent to for (Entry e : entries) map.put(e); (in pseudo code).

    Contrived example:

    public static void main(String[] args) throws Exception {
        Map<String, String> m = new LinkedHashMap<> (16, 0.75f, true);
    
        m.put("a", "a");
        m.put("b", "b");
        System.out.println("m = " + m); // a, b
        m.put("a", "a");
        System.out.println("m = " + m); // b, a
    
        Map<String, String> m2 = new LinkedHashMap<>();
        m2.put("b", "b");
    
        m.putAll(m2);
        System.out.println("m = " + m); // a, b: putAll was considered as an access
                                        // and the order has changed
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I was reading the JavaDoc for Threadlocal here https://docs.oracle.com/javase/1.5.0/docs/api/java/lang/ThreadLocal.html and it says ThreadLocal instances
Try this: DateFormat df = new SimpleDateFormat(y); System.out.println(df.format(new Date())); Without reading the javadoc for
HashMap's javadoc states: if the map is structurally modified at any time after the
Reading the javadoc for EhCacheManagerFactoryBean and EhCacheFactoryBean I figured that: <bean id=cacheManager class=org.springframework.cache.ehcache.EhCacheManagerFactoryBean p:configLocation=classpath:ehcache.xml/>
I was reading Collections.shuffle(List) javadoc and then took a look at the RandomAccess javadoc
I'm having trouble with rounding. Specifically, after reading all the javadoc, I was expecting
I was reading the Math.random() javadoc and saw that random is only psuedorandom. Is
After posting this question and reading that one I realized that it is very
Reading the docs, I'd expect $(#wrap2).remove(.error) to remove all .error elements from #wrap2 .
Reading across difference lineage of CPU created by intel , many questions aroused in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.