{"id":4795,"date":"2014-03-30T15:28:07","date_gmt":"2014-03-30T15:28:07","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/03\/30\/is-string-length-invoked-for-a-final-string-collection-of-common-programming-errors\/"},"modified":"2014-03-30T15:28:07","modified_gmt":"2014-03-30T15:28:07","slug":"is-string-length-invoked-for-a-final-string-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2014\/03\/30\/is-string-length-invoked-for-a-final-string-collection-of-common-programming-errors\/","title":{"rendered":"Is String.length() invoked for a final String?-Collection of common programming errors"},"content":{"rendered":"<p><code>str.length()<\/code> <em>is<\/em> evaluated at runtime. <code>final<\/code> means that value of the reference cannot be changed. It has nothing to do with the string itself.<\/p>\n<p>However, if you look into the source code of <code>String<\/code> you will see that <code>length()<\/code> returns the value of a field, so no computation takes place, the value os simply read&#8230;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>str.length() is evaluated at runtime. final means that value of the reference cannot be changed. It has nothing to do with the string itself. However, if you look into the source code of String you will see that length() returns the value of a field, so no computation takes place, the value os simply read&#8230;<\/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-4795","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/4795","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=4795"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/4795\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=4795"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=4795"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=4795"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}