{"id":598,"date":"2011-10-27T21:08:00","date_gmt":"2011-10-27T21:08:00","guid":{"rendered":"http:\/\/www.javacodegeeks.com\/2012\/10\/java-secret-loading-and-unloading-static-fields.html"},"modified":"2012-10-21T20:23:12","modified_gmt":"2012-10-21T20:23:12","slug":"java-secret-loading-and-unloading","status":"publish","type":"post","link":"https:\/\/www.javacodegeeks.com\/2011\/10\/java-secret-loading-and-unloading.html","title":{"rendered":"Java Secret: Loading and unloading static fields"},"content":{"rendered":"<div dir=\"ltr\" style=\"text-align: left\">\n<h2>OVERVIEW<\/h2>\n<p>To start with it is natural to assume that static fields have a special life cycle and live for the life of the application. You could assume that they live is a special place in memory like the start of memory in C or in the perm gen with the class meta information.<\/p>\n<p>However, it may be surprising to learn that static fields live on the heap, can have any number of copies and are cleaned up by the GC like any other object.<\/p>\n<p>This follows on from a previous discussion; <a href=\"http:\/\/vanillajava.blogspot.com\/2011\/07\/java-secret-are-static-blocks.html\">Are static blocks interpreted?<\/a><\/p>\n<h2>LOADING STATIC FIELDS<\/h2>\n<p>When a class is obtained for linking it may not result in the static block being intialised.<\/p>\n<p>A simple example<\/p>\n<pre class=\"brush: java\">public class ShortClassLoadingMain {\r\n    public static void main(String... args) {\r\n        System.out.println(\"Start\");\r\n        Class aClass = AClass.class;\r\n        System.out.println(\"Loaded\");\r\n        String s= AClass.ID;\r\n        System.out.println(\"Initialised\");\r\n    }\r\n}\r\n\r\nclass AClass {\r\n    static final String ID;\r\n    static {\r\n        System.out.println(\"AClass: Initialising\");\r\n        ID = \"ID\";\r\n    }\r\n}\r\n<\/pre>\n<p>prints<\/p>\n<pre class=\"brush: bash\">Start\r\nLoaded\r\nAClass: Initialising\r\nInitialised\r\n<\/pre>\n<p>You can see you can obtain a reference to a class, before it has been initialised, only when it is used does it get initialised.<\/p>\n<h2>LOADING MULTIPLE COPIES OF A STATIC FIELD<\/h2>\n<p>Each class loader which loads a class has its own copy of static fields. If you load a class in two different class loaders these classes can have static fields with different values.<div style=\"display:inline-block; margin: 15px 0;\"> <div id=\"adngin-JavaCodeGeeks_incontent_video-0\" style=\"display:inline-block;\"><\/div> <\/div><\/p>\n<h2>UNLOADING STATIC FIELDS<\/h2>\n<p>static fields are unloaded when the Class&#8217; ClassLoader is unloaded. This is unloaded when a GC is performed and there are no strong references from the threads&#8217; stacks.<\/p>\n<h2>PUTTING THESE TWO CONCEPTS TOGETHER<\/h2>\n<p>Here is an example where a class prints a message when it is initialised and when its fields are finalized.<\/p>\n<pre class=\"brush: java\">class UtilityClass {\r\n    static final String ID = Integer.toHexString(System.identityHashCode(UtilityClass.class));\r\n    private static final Object FINAL = new Object() {\r\n        @Override\r\n        protected void finalize() throws Throwable {\r\n            super.finalize();\r\n            System.out.println(ID + \" Finalized.\");\r\n        }\r\n    };\r\n\r\n    static {\r\n        System.out.println(ID + \" Initialising\");\r\n    }\r\n}\r\n<\/pre>\n<p>By loading this class repeatedly, twice at a time<\/p>\n<pre class=\"brush: java\">for (int i = 0; i &lt; 2; i++) {\r\n  cl = new CustomClassLoader(url);\r\n  clazz = cl.loadClass(className);\r\n  loadClass(clazz);\r\n\r\n  cl = new CustomClassLoader(url);\r\n  clazz = cl.loadClass(className);\r\n  loadClass(clazz);\r\n  triggerGC();\r\n}\r\ntriggerGC();\r\n<\/pre>\n<p>you can see an output like this  <\/p>\n<pre class=\"brush: bash\">1b17a8bd Initialising\r\n2f754ad2 Initialising\r\n\r\n-- Starting GC\r\n1b17a8bd Finalized.\r\n-- End of GC\r\n\r\n6ac2a132 Initialising\r\neb166b5 Initialising\r\n\r\n-- Starting GC\r\n6ac2a132 Finalized.\r\n2f754ad2 Finalized.\r\n-- End of GC\r\n\r\n\r\n-- Starting GC\r\neb166b5 Finalized.\r\n-- End of GC\r\n<\/pre>\n<p>In this log, two copies of the class are loaded first. The references to the first class\/classloader are overwritten by references to the second class\/classloader. The first one is cleaned up on a GC, the second one is retained. On the second loop, two more copies are initialised. The forth one is retained, the second and third are cleaned up on a GC. Finally the forth copy of the static fields are cleaned up on a GC when they are no longer references.<\/p>\n<h2>THE CODE<\/h2>\n<p><a href=\"http:\/\/code.google.com\/p\/core-java-performance-examples\/source\/browse\/trunk\/src\/main\/java\/com\/google\/code\/java\/core\/classloader\/ShortClassLoadingMain.java\">The first example &#8211; ShortClassLoadingMain<\/a> <a href=\"http:\/\/code.google.com\/p\/core-java-performance-examples\/source\/browse\/trunk\/src\/main\/java\/com\/google\/code\/java\/core\/classloader\/LoadAndUnloadMain.java\">The second example &#8211; LoadAndUnloadMain<\/a><\/p>\n<p><strong><i>Reference: <\/i><\/strong><a href=\"http:\/\/vanillajava.blogspot.com\/2011\/07\/java-secret-loading-and-unloading.html\">Java Secret: Loading and unloading static fields<\/a>&nbsp;from our <a href=\"http:\/\/www.javacodegeeks.com\/p\/jcg.html\">JCG partner<\/a> <a href=\"http:\/\/www.blogger.com\/profile\/17982030676088168612\">Peter Lawrey<\/a> at the <a href=\"http:\/\/vanillajava.blogspot.com\/\">Vanilla Java<\/a>.<\/p>\n<div style=\"margin-bottom: 0px;margin-left: 0px;margin-right: 0px;margin-top: 0px\"><strong>Related Articles:<\/strong><\/div>\n<ul style=\"text-align: left\">\n<li><a href=\"http:\/\/www.javacodegeeks.com\/2010\/12\/things-every-programmer-should-know.html\">Things Every Programmer Should Know<\/a><\/li>\n<li><a href=\"http:\/\/www.javacodegeeks.com\/2011\/01\/10-tips-proper-application-logging.html\">10 Tips for Proper Application Logging<\/a><\/li>\n<li><a href=\"http:\/\/www.javacodegeeks.com\/2011\/01\/laws-of-software-design.html\">Laws of Software Design<\/a><\/li>\n<li><a href=\"http:\/\/www.javacodegeeks.com\/?tag=java-best-practices\">Java Best Practices Series<\/a><\/li>\n<li><a href=\"http:\/\/www.javacodegeeks.com\/2011\/02\/9-tips-on-surviving-wild-west.html\">9 Tips on Surviving the Wild West Development Process<\/a><\/li>\n<\/ul>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>OVERVIEW To start with it is natural to assume that static fields have a special life cycle and live for the life of the application. You could assume that they live is a special place in memory like the start of memory in C or in the perm gen with the class meta information. However, &hellip;<\/p>\n","protected":false},"author":44,"featured_media":148,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7],"tags":[66,137,121],"class_list":["post-598","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-core-java","tag-java-best-practices","tag-performance","tag-performance-and-scalability"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Java Secret: Loading and unloading static fields - Java Code Geeks<\/title>\n<meta name=\"description\" content=\"OVERVIEWTo start with it is natural to assume that static fields have a special life cycle and live for the life of the application. You could assume that\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.javacodegeeks.com\/2011\/10\/java-secret-loading-and-unloading.html\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Java Secret: Loading and unloading static fields - Java Code Geeks\" \/>\n<meta property=\"og:description\" content=\"OVERVIEWTo start with it is natural to assume that static fields have a special life cycle and live for the life of the application. You could assume that\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.javacodegeeks.com\/2011\/10\/java-secret-loading-and-unloading.html\" \/>\n<meta property=\"og:site_name\" content=\"Java Code Geeks\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/javacodegeeks\" \/>\n<meta property=\"article:published_time\" content=\"2011-10-27T21:08:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2012-10-21T20:23:12+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/java-logo.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"150\" \/>\n\t<meta property=\"og:image:height\" content=\"150\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Peter Lawrey\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@javacodegeeks\" \/>\n<meta name=\"twitter:site\" content=\"@javacodegeeks\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Peter Lawrey\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2011\\\/10\\\/java-secret-loading-and-unloading.html#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2011\\\/10\\\/java-secret-loading-and-unloading.html\"},\"author\":{\"name\":\"Peter Lawrey\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/person\\\/8da43fffe34a1882e1402265732ec89e\"},\"headline\":\"Java Secret: Loading and unloading static fields\",\"datePublished\":\"2011-10-27T21:08:00+00:00\",\"dateModified\":\"2012-10-21T20:23:12+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2011\\\/10\\\/java-secret-loading-and-unloading.html\"},\"wordCount\":403,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2011\\\/10\\\/java-secret-loading-and-unloading.html#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/java-logo.jpg\",\"keywords\":[\"Java Best Practices\",\"Performance\",\"Performance and Scalability\"],\"articleSection\":[\"Core Java\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.javacodegeeks.com\\\/2011\\\/10\\\/java-secret-loading-and-unloading.html#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2011\\\/10\\\/java-secret-loading-and-unloading.html\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2011\\\/10\\\/java-secret-loading-and-unloading.html\",\"name\":\"Java Secret: Loading and unloading static fields - Java Code Geeks\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2011\\\/10\\\/java-secret-loading-and-unloading.html#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2011\\\/10\\\/java-secret-loading-and-unloading.html#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/java-logo.jpg\",\"datePublished\":\"2011-10-27T21:08:00+00:00\",\"dateModified\":\"2012-10-21T20:23:12+00:00\",\"description\":\"OVERVIEWTo start with it is natural to assume that static fields have a special life cycle and live for the life of the application. You could assume that\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2011\\\/10\\\/java-secret-loading-and-unloading.html#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.javacodegeeks.com\\\/2011\\\/10\\\/java-secret-loading-and-unloading.html\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2011\\\/10\\\/java-secret-loading-and-unloading.html#primaryimage\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/java-logo.jpg\",\"contentUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/java-logo.jpg\",\"width\":150,\"height\":150},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2011\\\/10\\\/java-secret-loading-and-unloading.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Java\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/category\\\/java\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Core Java\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/category\\\/java\\\/core-java\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"Java Secret: Loading and unloading static fields\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#website\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\",\"name\":\"Java Code Geeks\",\"description\":\"Java Developers Resource Center\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\"},\"alternateName\":\"JCG\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.javacodegeeks.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\",\"name\":\"Exelixis Media P.C.\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/exelixis-logo.png\",\"contentUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/exelixis-logo.png\",\"width\":864,\"height\":246,\"caption\":\"Exelixis Media P.C.\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/javacodegeeks\",\"https:\\\/\\\/x.com\\\/javacodegeeks\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/person\\\/8da43fffe34a1882e1402265732ec89e\",\"name\":\"Peter Lawrey\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/cbaad37aad868f26df8922ff947ff9f4311a7c2bf5c67f952728a35a330c4e66?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/cbaad37aad868f26df8922ff947ff9f4311a7c2bf5c67f952728a35a330c4e66?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/cbaad37aad868f26df8922ff947ff9f4311a7c2bf5c67f952728a35a330c4e66?s=96&d=mm&r=g\",\"caption\":\"Peter Lawrey\"},\"sameAs\":[\"http:\\\/\\\/vanillajava.blogspot.com\\\/\"],\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/author\\\/Peter-Lawrey\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Java Secret: Loading and unloading static fields - Java Code Geeks","description":"OVERVIEWTo start with it is natural to assume that static fields have a special life cycle and live for the life of the application. You could assume that","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.javacodegeeks.com\/2011\/10\/java-secret-loading-and-unloading.html","og_locale":"en_US","og_type":"article","og_title":"Java Secret: Loading and unloading static fields - Java Code Geeks","og_description":"OVERVIEWTo start with it is natural to assume that static fields have a special life cycle and live for the life of the application. You could assume that","og_url":"https:\/\/www.javacodegeeks.com\/2011\/10\/java-secret-loading-and-unloading.html","og_site_name":"Java Code Geeks","article_publisher":"https:\/\/www.facebook.com\/javacodegeeks","article_published_time":"2011-10-27T21:08:00+00:00","article_modified_time":"2012-10-21T20:23:12+00:00","og_image":[{"width":150,"height":150,"url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/java-logo.jpg","type":"image\/jpeg"}],"author":"Peter Lawrey","twitter_card":"summary_large_image","twitter_creator":"@javacodegeeks","twitter_site":"@javacodegeeks","twitter_misc":{"Written by":"Peter Lawrey","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.javacodegeeks.com\/2011\/10\/java-secret-loading-and-unloading.html#article","isPartOf":{"@id":"https:\/\/www.javacodegeeks.com\/2011\/10\/java-secret-loading-and-unloading.html"},"author":{"name":"Peter Lawrey","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/person\/8da43fffe34a1882e1402265732ec89e"},"headline":"Java Secret: Loading and unloading static fields","datePublished":"2011-10-27T21:08:00+00:00","dateModified":"2012-10-21T20:23:12+00:00","mainEntityOfPage":{"@id":"https:\/\/www.javacodegeeks.com\/2011\/10\/java-secret-loading-and-unloading.html"},"wordCount":403,"commentCount":0,"publisher":{"@id":"https:\/\/www.javacodegeeks.com\/#organization"},"image":{"@id":"https:\/\/www.javacodegeeks.com\/2011\/10\/java-secret-loading-and-unloading.html#primaryimage"},"thumbnailUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/java-logo.jpg","keywords":["Java Best Practices","Performance","Performance and Scalability"],"articleSection":["Core Java"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.javacodegeeks.com\/2011\/10\/java-secret-loading-and-unloading.html#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.javacodegeeks.com\/2011\/10\/java-secret-loading-and-unloading.html","url":"https:\/\/www.javacodegeeks.com\/2011\/10\/java-secret-loading-and-unloading.html","name":"Java Secret: Loading and unloading static fields - Java Code Geeks","isPartOf":{"@id":"https:\/\/www.javacodegeeks.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.javacodegeeks.com\/2011\/10\/java-secret-loading-and-unloading.html#primaryimage"},"image":{"@id":"https:\/\/www.javacodegeeks.com\/2011\/10\/java-secret-loading-and-unloading.html#primaryimage"},"thumbnailUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/java-logo.jpg","datePublished":"2011-10-27T21:08:00+00:00","dateModified":"2012-10-21T20:23:12+00:00","description":"OVERVIEWTo start with it is natural to assume that static fields have a special life cycle and live for the life of the application. You could assume that","breadcrumb":{"@id":"https:\/\/www.javacodegeeks.com\/2011\/10\/java-secret-loading-and-unloading.html#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.javacodegeeks.com\/2011\/10\/java-secret-loading-and-unloading.html"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.javacodegeeks.com\/2011\/10\/java-secret-loading-and-unloading.html#primaryimage","url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/java-logo.jpg","contentUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/java-logo.jpg","width":150,"height":150},{"@type":"BreadcrumbList","@id":"https:\/\/www.javacodegeeks.com\/2011\/10\/java-secret-loading-and-unloading.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.javacodegeeks.com\/"},{"@type":"ListItem","position":2,"name":"Java","item":"https:\/\/www.javacodegeeks.com\/category\/java"},{"@type":"ListItem","position":3,"name":"Core Java","item":"https:\/\/www.javacodegeeks.com\/category\/java\/core-java"},{"@type":"ListItem","position":4,"name":"Java Secret: Loading and unloading static fields"}]},{"@type":"WebSite","@id":"https:\/\/www.javacodegeeks.com\/#website","url":"https:\/\/www.javacodegeeks.com\/","name":"Java Code Geeks","description":"Java Developers Resource Center","publisher":{"@id":"https:\/\/www.javacodegeeks.com\/#organization"},"alternateName":"JCG","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.javacodegeeks.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.javacodegeeks.com\/#organization","name":"Exelixis Media P.C.","url":"https:\/\/www.javacodegeeks.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/logo\/image\/","url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","contentUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","width":864,"height":246,"caption":"Exelixis Media P.C."},"image":{"@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/javacodegeeks","https:\/\/x.com\/javacodegeeks"]},{"@type":"Person","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/person\/8da43fffe34a1882e1402265732ec89e","name":"Peter Lawrey","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/cbaad37aad868f26df8922ff947ff9f4311a7c2bf5c67f952728a35a330c4e66?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/cbaad37aad868f26df8922ff947ff9f4311a7c2bf5c67f952728a35a330c4e66?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/cbaad37aad868f26df8922ff947ff9f4311a7c2bf5c67f952728a35a330c4e66?s=96&d=mm&r=g","caption":"Peter Lawrey"},"sameAs":["http:\/\/vanillajava.blogspot.com\/"],"url":"https:\/\/www.javacodegeeks.com\/author\/Peter-Lawrey"}]}},"_links":{"self":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/598","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/users\/44"}],"replies":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/comments?post=598"}],"version-history":[{"count":0,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/598\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/media\/148"}],"wp:attachment":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/media?parent=598"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/categories?post=598"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/tags?post=598"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}