{"id":83171,"date":"2020-01-08T15:00:00","date_gmt":"2020-01-08T13:00:00","guid":{"rendered":"http:\/\/examples.javacodegeeks.com\/?p=83171"},"modified":"2021-09-17T14:01:26","modified_gmt":"2021-09-17T11:01:26","slug":"java-struct-example","status":"publish","type":"post","link":"https:\/\/examples.javacodegeeks.com\/java-struct-example\/","title":{"rendered":"Java Struct Example"},"content":{"rendered":"<h2 class=\"wp-block-heading\">1. Introduction<\/h2>\n<p>This article focuses on Structs in Java and not Structs framework. Structs are similar to the class that holds different types of data and it is a value type. It is used to create lightweight objects and also when data is not modified after creation. Although it is useful, it is not present in Java. Many of us have confusion about whether Java supports Structs or not?<\/p>\n<p class=\"has-text-align-left\">Yes, Java doesn&#8217;t have a <strong>struct\/value type yet.<\/strong><\/p>\n<p class=\"has-text-align-left\">But you have good news as well. Project JUnion delivers struct types for Java programming language. So you can use Struct types in java by using Project JUnion plugin by annotating a class with @Struct annotation. <\/p>\n<h2 class=\"wp-block-heading\" id=\"h-2-installation\">2. Installation <\/h2>\n<p>You can find many options to use this Project JUnion, such as source translator, compiler plugin, eclipse plugin, Netbeans plugin, ant or maven build. A convenient option would be to install it in eclipse as a plugin or add it as the maven dependency. Here I am going to walk you through the installation.<\/p>\n<ul class=\"wp-block-list\">\n<li>Goto Eclipse -&gt; Help -&gt; Install New Software<\/li>\n<li>Enter site: https:\/\/tehleo.github.io\/junion\/update<\/li>\n<\/ul>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img decoding=\"async\" width=\"566\" height=\"464\" src=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2020\/01\/junion1.jpg\" alt=\"Java Struct - Installation step 1\" class=\"wp-image-83288\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2020\/01\/junion1.jpg 566w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2020\/01\/junion1-300x246.jpg 300w\" sizes=\"(max-width: 566px) 100vw, 566px\" \/><figcaption>Installation step 1<\/figcaption><\/figure>\n<\/div>\n<ul class=\"wp-block-list\">\n<li>Select JUnion plugin and select next.<\/li>\n<\/ul>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img decoding=\"async\" width=\"565\" height=\"447\" src=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2020\/01\/junion2.jpg\" alt=\"Java Struct - Installation step 2\" class=\"wp-image-83289\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2020\/01\/junion2.jpg 565w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2020\/01\/junion2-300x237.jpg 300w\" sizes=\"(max-width: 565px) 100vw, 565px\" \/><figcaption>Installation step 2<\/figcaption><\/figure>\n<\/div>\n<ul class=\"wp-block-list\">\n<li>Accept the license agreement and continue with the installation<\/li>\n<\/ul>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img decoding=\"async\" width=\"564\" height=\"447\" src=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2020\/01\/junion3.jpg\" alt=\"\" class=\"wp-image-83290\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2020\/01\/junion3.jpg 564w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2020\/01\/junion3-300x238.jpg 300w\" sizes=\"(max-width: 564px) 100vw, 564px\" \/><figcaption>Installation step 3<\/figcaption><\/figure>\n<\/div>\n<ul class=\"wp-block-list\">\n<li>Please wait till the installation complete.<\/li>\n<li>Select the &#8220;Restart Now&#8221; option in software update dialog.<\/li>\n<\/ul>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img decoding=\"async\" width=\"464\" height=\"351\" src=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2020\/01\/junion4.jpg\" alt=\"\" class=\"wp-image-83291\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2020\/01\/junion4.jpg 464w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2020\/01\/junion4-300x227.jpg 300w\" sizes=\"(max-width: 464px) 100vw, 464px\" \/><figcaption>Installation step 4<\/figcaption><\/figure>\n<\/div>\n<ul class=\"wp-block-list\">\n<li>Add external jar and pick junion.jar <\/li>\n<li>Download junion.jar and junionc.jar from https:\/\/tehleo.github.io\/junion\/download.html or from other download sites.<\/li>\n<\/ul>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img decoding=\"async\" width=\"606\" height=\"442\" src=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2020\/01\/junion5.jpg\" alt=\"\" class=\"wp-image-83292\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2020\/01\/junion5.jpg 606w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2020\/01\/junion5-300x219.jpg 300w\" sizes=\"(max-width: 606px) 100vw, 606px\" \/><figcaption>Installation step 5<\/figcaption><\/figure>\n<\/div>\n<ul class=\"wp-block-list\">\n<li>Goto Window -&gt; Preferences -&gt; Java -&gt; Compiler -&gt; Error\/Warnings -&gt; Deprecated or Restricted API Set Forbidden Reference to Warning.<\/li>\n<\/ul>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img decoding=\"async\" width=\"551\" height=\"447\" src=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2020\/01\/junion6.jpg\" alt=\"\" class=\"wp-image-83293\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2020\/01\/junion6.jpg 551w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2020\/01\/junion6-300x243.jpg 300w\" sizes=\"(max-width: 551px) 100vw, 551px\" \/><figcaption>Installation step 6<\/figcaption><\/figure>\n<\/div>\n<ul class=\"wp-block-list\">\n<li>Create a new Java project and create a new file named .junion<\/li>\n<li>In .junion property file, set property compileLibs= path to junionc&lt;version&gt;.jar. Save the file<\/li>\n<li>Now you will see \u201c.generated_src_junion\u201d folder generated automatically<\/li>\n<li>Add the above folder in the build path. Goto properties <strong>-&gt; J<\/strong>ava Build Path -&gt; Sources -&gt; Add Folder and add .generated_src_junion<\/li>\n<li>Now you are ready to use @Struct in your java project s installation is successful.<\/li>\n<\/ul>\n<h2 class=\"wp-block-heading\" id=\"h-3-how-to-use-struct-in-java\">3. How to use Struct in java<\/h2>\n<p>As like in c++, you can also use Struct in java. <div style=\"display:inline-block; margin: 15px 0;\"> <div id=\"adngin-JavaCodeGeeks_incontent_video-0\" style=\"display:inline-block;\"><\/div> <\/div><\/p>\n<p><span style=\"text-decoration: underline\"><em>Code Example1<\/em><\/span><\/p>\n<pre class=\"brush:java\">package com.kavi.geek;\n\nimport theleo.jstruct.Struct;\n\npublic class StructExample {\n\n\t@Struct\n\tpublic static class EmpName {\n\t    public String firstName,middleName,lastName;\n\t}\n\n\tpublic static void main(String[] args) {\n\t\t\n\t\tEmpName[] empArray = new EmpName[2];\n\t\tempArray[0].firstName=\"Java\";\n\t\tempArray[0].middleName=\"Code\";\n\t\tempArray[0].lastName=\"Geek\";\n\t\tSystem.out.println(\"Name : \"+empArray[0].firstName\n\t\t\t\t+\" \"+empArray[0].middleName\n\t\t\t\t+\" \"+empArray[0].lastName);\n\t}\n\n} <\/pre>\n<p><span style=\"text-decoration: underline\"><em>Output<\/em><\/span><\/p>\n<pre class=\"brush:java\">Name : Java Code Geek<\/pre>\n<p><span style=\"text-decoration: underline\"><em>Code Example2<\/em><\/span><\/p>\n<pre class=\"brush:java\">\t\tint[] primitiveArray = new int[500];  \n\t\tInteger[] intObjectArray = new Integer[500];\n <\/pre>\n<p>In the above code, we all agree primitive array consumes less memory than Integer object array. You might have a question like why you should use Structs? Why can&#8217;t you have a class instead of a struct? <\/p>\n<p>The answer is simple. Reasons are <\/p>\n<ul class=\"wp-block-list\">\n<li>Struct types use less memory<\/li>\n<li>It performs better than the object.<\/li>\n<li>Performance of primitive array is far better<\/li>\n<\/ul>\n<h2 class=\"wp-block-heading\" id=\"h-4-conclusion\">4. Conclusion<\/h2>\n<p>Struct types define data types, which use less memory as possible. Few features are implemented and still few are in progress. Should you like to check the implemented features, go to <a href=\"https:\/\/github.com\/TehLeo\/junion\/blob\/master\/docs\/wiki\/structs.md\">https:\/\/github.com\/TehLeo\/junion\/blob\/master\/docs\/wiki\/structs.md<\/a>. As this article is based on Project JUnion, the content is picked from <a href=\"https:\/\/tehleo.github.io\/junion\/features.html\">https:\/\/tehleo.github.io\/junion\/features.html<\/a><\/p>\n<h2 class=\"wp-block-heading\">5. More articles<\/h2>\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/examples.javacodegeeks.com\/java-tutorial-for-beginners\/\">Java Tutorial for Beginners (with video)<\/a><\/li>\n<li><a href=\"https:\/\/examples.javacodegeeks.com\/java-map-example\/\">Java Map Example<\/a><\/li>\n<li><a href=\"https:\/\/examples.javacodegeeks.com\/java-queue-example\/\">Java Queue Example (with video)<\/a><\/li>\n<li><a href=\"https:\/\/examples.javacodegeeks.com\/java-stack-example\/\">Java Stack Example (with video)<\/a><\/li>\n<li><a href=\"https:\/\/examples.javacodegeeks.com\/java-collections-tutorial\/\">Java Collections Tutorial<\/a><\/li>\n<li><a href=\"https:\/\/examples.javacodegeeks.com\/linkedlist-java-example\/\">LinkedList Java Example (with video)<\/a><\/li>\n<li><a href=\"https:\/\/examples.javacodegeeks.com\/hashset-java-example\/\">Hashset Java Example<\/a><\/li>\n<\/ul>\n<h2 class=\"wp-block-heading\">6. Download the Source Code<\/h2>\n<p>This was an example of how to use Structs in java using Project JUnion.<\/p>\n<div class=\"download\"><strong>Download<\/strong><br \/>\nYou can download the full source code of this example here: <a href=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2020\/01\/StructsExample.zip\"><strong>Java Struct Example<\/strong><\/a><\/div>\n<p><strong>Last updated on Aug. 03rd, 2021<\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"<p>1. Introduction This article focuses on Structs in Java and not Structs framework. Structs are similar to the class that holds different types of data and it is a value type. It is used to create lightweight objects and also when data is not modified after creation. Although it is useful, it is not present &hellip;<\/p>\n","protected":false},"author":206,"featured_media":1204,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[],"class_list":["post-83171","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-core-java"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Java Struct Example - Java Code Geeks<\/title>\n<meta name=\"description\" content=\"Structs in Java are similar to the class that holds different types of data and it is a value type. It is used to create lightweight objects.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/examples.javacodegeeks.com\/java-struct-example\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Java Struct Example - Java Code Geeks\" \/>\n<meta property=\"og:description\" content=\"Structs in Java are similar to the class that holds different types of data and it is a value type. It is used to create lightweight objects.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/examples.javacodegeeks.com\/java-struct-example\/\" \/>\n<meta property=\"og:site_name\" content=\"Examples Java Code Geeks\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/javacodegeeks\" \/>\n<meta property=\"article:published_time\" content=\"2020-01-08T13:00:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-09-17T11:01:26+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2012\/12\/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=\"Kavitha Ashok\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@jo_nitsa\" \/>\n<meta name=\"twitter:site\" content=\"@javacodegeeks\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Kavitha Ashok\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/java-struct-example\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/java-struct-example\/\"},\"author\":{\"name\":\"Kavitha Ashok\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/512037def13ad0d7efa6e4cd497c49c6\"},\"headline\":\"Java Struct Example\",\"datePublished\":\"2020-01-08T13:00:00+00:00\",\"dateModified\":\"2021-09-17T11:01:26+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/java-struct-example\/\"},\"wordCount\":582,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/java-struct-example\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2012\/12\/java-logo.jpg\",\"articleSection\":[\"Core Java\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/examples.javacodegeeks.com\/java-struct-example\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/java-struct-example\/\",\"url\":\"https:\/\/examples.javacodegeeks.com\/java-struct-example\/\",\"name\":\"Java Struct Example - Java Code Geeks\",\"isPartOf\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/java-struct-example\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/java-struct-example\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2012\/12\/java-logo.jpg\",\"datePublished\":\"2020-01-08T13:00:00+00:00\",\"dateModified\":\"2021-09-17T11:01:26+00:00\",\"description\":\"Structs in Java are similar to the class that holds different types of data and it is a value type. It is used to create lightweight objects.\",\"breadcrumb\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/java-struct-example\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/examples.javacodegeeks.com\/java-struct-example\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/java-struct-example\/#primaryimage\",\"url\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2012\/12\/java-logo.jpg\",\"contentUrl\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2012\/12\/java-logo.jpg\",\"width\":150,\"height\":150,\"caption\":\"Bipartite Graph\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/java-struct-example\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/examples.javacodegeeks.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Java Development\",\"item\":\"https:\/\/examples.javacodegeeks.com\/category\/java-development\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Core Java\",\"item\":\"https:\/\/examples.javacodegeeks.com\/category\/java-development\/core-java\/\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"Java Struct Example\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/#website\",\"url\":\"https:\/\/examples.javacodegeeks.com\/\",\"name\":\"Java Code Geeks\",\"description\":\"Java Examples and Code Snippets\",\"publisher\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/#organization\"},\"alternateName\":\"JCG\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/examples.javacodegeeks.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/#organization\",\"name\":\"Exelixis Media P.C.\",\"url\":\"https:\/\/examples.javacodegeeks.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png\",\"contentUrl\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png\",\"width\":864,\"height\":246,\"caption\":\"Exelixis Media P.C.\"},\"image\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/javacodegeeks\",\"https:\/\/x.com\/javacodegeeks\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/512037def13ad0d7efa6e4cd497c49c6\",\"name\":\"Kavitha Ashok\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/25c88034a444704e7ddc306b48c613fc47b244cbba80eaee20404dc7906968c0?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/25c88034a444704e7ddc306b48c613fc47b244cbba80eaee20404dc7906968c0?s=96&d=mm&r=g\",\"caption\":\"Kavitha Ashok\"},\"description\":\"Kavitha has a Master's degree in Information Technology and a Master's degree in Business Administration. She started her career as a Junior Software Developer trainee and moved up as a Technical lead. She has been involved with projects in various domains such as CMS, IMS, android and digital TV products, applications, web services, etc. , She is mainly involved in development, design, analysis, refactoring, etc., based on Java and other technologies.\",\"sameAs\":[\"www.linkedin.com\/in\/kashok-79497116a\",\"https:\/\/x.com\/jo_nitsa\"],\"url\":\"https:\/\/examples.javacodegeeks.com\/author\/kavitha-ashok\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Java Struct Example - Java Code Geeks","description":"Structs in Java are similar to the class that holds different types of data and it is a value type. It is used to create lightweight objects.","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:\/\/examples.javacodegeeks.com\/java-struct-example\/","og_locale":"en_US","og_type":"article","og_title":"Java Struct Example - Java Code Geeks","og_description":"Structs in Java are similar to the class that holds different types of data and it is a value type. It is used to create lightweight objects.","og_url":"https:\/\/examples.javacodegeeks.com\/java-struct-example\/","og_site_name":"Examples Java Code Geeks","article_publisher":"https:\/\/www.facebook.com\/javacodegeeks","article_published_time":"2020-01-08T13:00:00+00:00","article_modified_time":"2021-09-17T11:01:26+00:00","og_image":[{"width":150,"height":150,"url":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2012\/12\/java-logo.jpg","type":"image\/jpeg"}],"author":"Kavitha Ashok","twitter_card":"summary_large_image","twitter_creator":"@jo_nitsa","twitter_site":"@javacodegeeks","twitter_misc":{"Written by":"Kavitha Ashok","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/examples.javacodegeeks.com\/java-struct-example\/#article","isPartOf":{"@id":"https:\/\/examples.javacodegeeks.com\/java-struct-example\/"},"author":{"name":"Kavitha Ashok","@id":"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/512037def13ad0d7efa6e4cd497c49c6"},"headline":"Java Struct Example","datePublished":"2020-01-08T13:00:00+00:00","dateModified":"2021-09-17T11:01:26+00:00","mainEntityOfPage":{"@id":"https:\/\/examples.javacodegeeks.com\/java-struct-example\/"},"wordCount":582,"commentCount":0,"publisher":{"@id":"https:\/\/examples.javacodegeeks.com\/#organization"},"image":{"@id":"https:\/\/examples.javacodegeeks.com\/java-struct-example\/#primaryimage"},"thumbnailUrl":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2012\/12\/java-logo.jpg","articleSection":["Core Java"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/examples.javacodegeeks.com\/java-struct-example\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/examples.javacodegeeks.com\/java-struct-example\/","url":"https:\/\/examples.javacodegeeks.com\/java-struct-example\/","name":"Java Struct Example - Java Code Geeks","isPartOf":{"@id":"https:\/\/examples.javacodegeeks.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/examples.javacodegeeks.com\/java-struct-example\/#primaryimage"},"image":{"@id":"https:\/\/examples.javacodegeeks.com\/java-struct-example\/#primaryimage"},"thumbnailUrl":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2012\/12\/java-logo.jpg","datePublished":"2020-01-08T13:00:00+00:00","dateModified":"2021-09-17T11:01:26+00:00","description":"Structs in Java are similar to the class that holds different types of data and it is a value type. It is used to create lightweight objects.","breadcrumb":{"@id":"https:\/\/examples.javacodegeeks.com\/java-struct-example\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/examples.javacodegeeks.com\/java-struct-example\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/examples.javacodegeeks.com\/java-struct-example\/#primaryimage","url":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2012\/12\/java-logo.jpg","contentUrl":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2012\/12\/java-logo.jpg","width":150,"height":150,"caption":"Bipartite Graph"},{"@type":"BreadcrumbList","@id":"https:\/\/examples.javacodegeeks.com\/java-struct-example\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/examples.javacodegeeks.com\/"},{"@type":"ListItem","position":2,"name":"Java Development","item":"https:\/\/examples.javacodegeeks.com\/category\/java-development\/"},{"@type":"ListItem","position":3,"name":"Core Java","item":"https:\/\/examples.javacodegeeks.com\/category\/java-development\/core-java\/"},{"@type":"ListItem","position":4,"name":"Java Struct Example"}]},{"@type":"WebSite","@id":"https:\/\/examples.javacodegeeks.com\/#website","url":"https:\/\/examples.javacodegeeks.com\/","name":"Java Code Geeks","description":"Java Examples and Code Snippets","publisher":{"@id":"https:\/\/examples.javacodegeeks.com\/#organization"},"alternateName":"JCG","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/examples.javacodegeeks.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/examples.javacodegeeks.com\/#organization","name":"Exelixis Media P.C.","url":"https:\/\/examples.javacodegeeks.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/examples.javacodegeeks.com\/#\/schema\/logo\/image\/","url":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","contentUrl":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","width":864,"height":246,"caption":"Exelixis Media P.C."},"image":{"@id":"https:\/\/examples.javacodegeeks.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/javacodegeeks","https:\/\/x.com\/javacodegeeks"]},{"@type":"Person","@id":"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/512037def13ad0d7efa6e4cd497c49c6","name":"Kavitha Ashok","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/25c88034a444704e7ddc306b48c613fc47b244cbba80eaee20404dc7906968c0?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/25c88034a444704e7ddc306b48c613fc47b244cbba80eaee20404dc7906968c0?s=96&d=mm&r=g","caption":"Kavitha Ashok"},"description":"Kavitha has a Master's degree in Information Technology and a Master's degree in Business Administration. She started her career as a Junior Software Developer trainee and moved up as a Technical lead. She has been involved with projects in various domains such as CMS, IMS, android and digital TV products, applications, web services, etc. , She is mainly involved in development, design, analysis, refactoring, etc., based on Java and other technologies.","sameAs":["www.linkedin.com\/in\/kashok-79497116a","https:\/\/x.com\/jo_nitsa"],"url":"https:\/\/examples.javacodegeeks.com\/author\/kavitha-ashok\/"}]}},"_links":{"self":[{"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/83171","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/users\/206"}],"replies":[{"embeddable":true,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/comments?post=83171"}],"version-history":[{"count":0,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/83171\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/media\/1204"}],"wp:attachment":[{"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/media?parent=83171"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/categories?post=83171"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/tags?post=83171"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}