ã¨ããããã§ä»¥ä¸ã®ãããªé©å½ãªããã°ã©ã ãã»ã»ã» ãµã³ãã«ã§ã¯åMapå®è£ ã®æåãè¦ãããã®ä¿®æ£ç®æãçµãããã£ãã®ã§ ãããªæãã§ããã Mapã¤ã³ã¿ã¼ãã§ã¼ã¹ã§åããªãæ¹ãã ConcurrentHashMapã«ããã¢ãããã¯ãªã¡ã½ããã使ãã¦ä¾¿å©ãªã±ã¼ã¹ãå¤ãã§ãã putIfAbsentã¨ãã ã¾ããåæãããã¨ããç¹ã®ã¢ãã¼ã«ã§ãMapã§åããªãæ¹ãå¯èªæ§ãããããã ConcurrentMapã¤ã³ã¿ã¼ãã§ã¼ã¹ã§åãã¦ããããã©ãå®è£ ã¯ã©ã¹ãéå®ããã¦ããã®ã§ããã </p> <pre class="code" data-lang="" data-unlink>package collection.map; import java.util.Collections; import java.util.HashMap; import java.util.Iterator; impo
{{#tags}}- {{label}}
{{/tags}}