{"id":5091,"date":"2014-03-30T18:45:10","date_gmt":"2014-03-30T18:45:10","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/03\/30\/are-there-any-guarantees-when-modifying-arguments-during-method-invocation-collection-of-common-programming-errors\/"},"modified":"2014-03-30T18:45:10","modified_gmt":"2014-03-30T18:45:10","slug":"are-there-any-guarantees-when-modifying-arguments-during-method-invocation-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2014\/03\/30\/are-there-any-guarantees-when-modifying-arguments-during-method-invocation-collection-of-common-programming-errors\/","title":{"rendered":"Are there any guarantees when modifying arguments during method invocation?-Collection of common programming errors"},"content":{"rendered":"<p>In Java when passing arguments to a method and modifying the passed arguments <em>during<\/em> the method call is it guaranteed that the result is what is expected? E.g.<\/p>\n<p><code>a.method(++i);<\/code> etc<\/p>\n<p>Is it <strong>guaranteed<\/strong> for instance that inside <code>method<\/code> the variable <code>i<\/code> will have the updated value?<\/p>\n<p>Or <code>a.method(i++)<\/code> Will <code>method<\/code> get the value of <code>i<\/code> after incrementing or before?<\/p>\n<p>Also same for all similar cases.<br \/>\nI kind of remember this is forbidden in C++ as implementation specific but perhaps I remember wrong.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In Java when passing arguments to a method and modifying the passed arguments during the method call is it guaranteed that the result is what is expected? E.g. a.method(++i); etc Is it guaranteed for instance that inside method the variable i will have the updated value? Or a.method(i++) Will method get the value of i [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-5091","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/5091","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=5091"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/5091\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=5091"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=5091"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=5091"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}