{"id":47527,"date":"2024-07-08T18:02:22","date_gmt":"2024-07-08T18:02:22","guid":{"rendered":"https:\/\/www.oracletutoring.ca\/blog\/?p=47527"},"modified":"2024-07-08T18:02:23","modified_gmt":"2024-07-08T18:02:23","slug":"computer-science-concurrent-modification-exception","status":"publish","type":"post","link":"https:\/\/www.oracletutoring.ca\/blog\/computer-science-concurrent-modification-exception\/","title":{"rendered":"Computer science: Concurrent Modification Exception"},"content":{"rendered":"\n<h2>Self-tutoring about Java and programming: the tutor mentions the concurrent modification exception.<\/h2>\n<p>\nToday I was experimenting with the Java type ArrayList. I don&#8217;t always program in Java, although I am a fan of it. I&#8217;m about to use some terms in ways that might not be absolutely Java precise, but convey ideas.<\/p>\n<p>\nAs I understand, an ArrayList is self-resizing. Therefore, unlike an array, it doesn&#8217;t have its members in set places, necessarily. Rather, the members&#8217; positions may change, for instance, when earlier members in the ArrayList are removed.<\/p>\n<p>\nBecause of the fact that a member of the ArrayList can thus shuffle forward, one can&#8217;t iterate over it while removing items from it. If one tries to, the Concurrent Modification Exception comes up, in my experience. It seems, however, that one can remove an item and then break out from the iteration.<\/p>\n<p>Source:<\/p>\n<p><a href=\"https:\/\/docs.oracle.com\/javase\/8\/docs\/api\/java\/util\/ConcurrentModificationException.html\">docs.oracle.com<\/a><\/p>\nJack of <a href=\"https:\/\/www.oracletutoring.ca\">Oracle Tutoring by Jack and Diane,<\/a> Campbell River, BC.\n","protected":false},"excerpt":{"rendered":"<p>Self-tutoring about Java and programming: the tutor mentions the concurrent modification exception. Today I was experimenting with the Java type ArrayList. I don&#8217;t always program in Java, although I am a fan of it. I&#8217;m about to use some terms &hellip;<\/p>\n<p class=\"read-more\"> <a class=\"more-link\" href=\"https:\/\/www.oracletutoring.ca\/blog\/computer-science-concurrent-modification-exception\/\"> <span class=\"screen-reader-text\">Computer science: Concurrent Modification Exception<\/span> Read More &raquo;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2780],"tags":[3230,3233,3229,3231,3232,761],"class_list":["post-47527","post","type-post","status-publish","format-standard","hentry","category-programming","tag-arraylist","tag-break","tag-collection","tag-exception","tag-iterate","tag-java"],"_links":{"self":[{"href":"https:\/\/www.oracletutoring.ca\/blog\/wp-json\/wp\/v2\/posts\/47527","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.oracletutoring.ca\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.oracletutoring.ca\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.oracletutoring.ca\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.oracletutoring.ca\/blog\/wp-json\/wp\/v2\/comments?post=47527"}],"version-history":[{"count":3,"href":"https:\/\/www.oracletutoring.ca\/blog\/wp-json\/wp\/v2\/posts\/47527\/revisions"}],"predecessor-version":[{"id":47530,"href":"https:\/\/www.oracletutoring.ca\/blog\/wp-json\/wp\/v2\/posts\/47527\/revisions\/47530"}],"wp:attachment":[{"href":"https:\/\/www.oracletutoring.ca\/blog\/wp-json\/wp\/v2\/media?parent=47527"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.oracletutoring.ca\/blog\/wp-json\/wp\/v2\/categories?post=47527"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.oracletutoring.ca\/blog\/wp-json\/wp\/v2\/tags?post=47527"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}