{"id":44,"date":"2019-01-16T00:56:56","date_gmt":"2019-01-16T00:56:56","guid":{"rendered":"https:\/\/kindsonthegenius.com\/java\/?p=44"},"modified":"2020-07-25T13:03:19","modified_gmt":"2020-07-25T13:03:19","slug":"08-java-variable-types","status":"publish","type":"post","link":"https:\/\/www.kindsonthegenius.com\/java\/08-java-variable-types\/","title":{"rendered":"Java &#8211; Variable Types"},"content":{"rendered":"\r\n<p>I&#8217;m sure you already know what a variable in Java is. Just a memory location to store values. However, you have the power to provide a name for variables. Additionally, you can also specify the data type of variables.<\/p>\r\n\r\n\r\n\r\n<p>We are going to examine:<\/p>\r\n\r\n\r\n\r\n<ol class=\"wp-block-list\">\r\n<li><a href=\"#t1\">Local Variables<\/a><\/li>\r\n<li><a href=\"#t2\">Instance Variables<\/a><\/li>\r\n<li><a href=\"#t2\">Class Variable (also called Static Variables)<\/a><\/li>\r\n<\/ol>\r\n\r\n<p>&nbsp;<\/p>\r\n\r\n\r\n\r\n<h4 class=\"wp-block-heading\"><strong id=\"t1\">1. Local Variables<\/strong><\/h4>\r\n\r\n\r\n\r\n<p>Note the following properties of local variables:<\/p>\r\n\r\n\r\n\r\n<ul class=\"wp-block-list\">\r\n<li>Declared inside block of codes. For example inside, methods or constructors<\/li>\r\n<li>Not visible outside the block<\/li>\r\n<li>Cannot be used with access modifiers<\/li>\r\n<li>Implemented internally using a stack<\/li>\r\n<li>Best to initialize it when declared<\/li>\r\n<\/ul>\r\n\r\n\r\n\r\n<p>Let&#8217;s take an example<\/p>\r\n<!-- HTML generated using hilite.me -->\r\n<div style=\"background: #ffffff; overflow: auto; width: auto; border: solid gray; border-width: .1em .1em .1em .8em; padding: .2em .6em;\">\r\n<pre style=\"margin: 0; line-height: 125%;\"><span style=\"color: #008800; font-weight: bold;\">public<\/span> <span style=\"color: #008800; font-weight: bold;\">class<\/span> <span style=\"color: #bb0066; font-weight: bold;\">Tester<\/span> <span style=\"color: #333333;\">{<\/span>\r\n\r\n\t<span style=\"color: #008800; font-weight: bold;\">public<\/span> <span style=\"color: #333399; font-weight: bold;\">void<\/span> <span style=\"color: #0066bb; font-weight: bold;\">IncreasePay<\/span><span style=\"color: #333333;\">(<\/span><span style=\"color: #333399; font-weight: bold;\">int<\/span> pay<span style=\"color: #333333;\">)<\/span> <span style=\"color: #333333;\">{<\/span>\r\n\t\t<span style=\"color: #333399; font-weight: bold;\">int<\/span> amount <span style=\"color: #333333;\">=<\/span> <span style=\"color: #0000dd; font-weight: bold;\">100<\/span><span style=\"color: #333333;\">;<\/span> <span style=\"color: #888888;\">\/\/ local variable<\/span>\r\n\t\t<span style=\"color: #333399; font-weight: bold;\">int<\/span> newPay <span style=\"color: #333333;\">=<\/span> pay <span style=\"color: #333333;\">+<\/span> amount<span style=\"color: #333333;\">;<\/span> <span style=\"color: #888888;\">\/\/local variable<\/span>\r\n\t\tSystem<span style=\"color: #333333;\">.<\/span><span style=\"color: #0000cc;\">out<\/span><span style=\"color: #333333;\">.<\/span><span style=\"color: #0000cc;\">printf<\/span><span style=\"color: #333333;\">(<\/span><span style=\"background-color: #fff0f0;\">\"Pay has increased from %d to %d \"<\/span><span style=\"color: #333333;\">,<\/span> pay<span style=\"color: #333333;\">,<\/span> newPay<span style=\"color: #333333;\">);<\/span>\r\n\t<span style=\"color: #333333;\">}<\/span>\r\n\t\r\n\t<span style=\"color: #008800; font-weight: bold;\">public<\/span> <span style=\"color: #008800; font-weight: bold;\">static<\/span> <span style=\"color: #333399; font-weight: bold;\">void<\/span> <span style=\"color: #0066bb; font-weight: bold;\">main<\/span><span style=\"color: #333333;\">(<\/span>String<span style=\"color: #333333;\">[]<\/span> args<span style=\"color: #333333;\">)<\/span> <span style=\"color: #333333;\">{<\/span>\r\n\t\tamount <span style=\"color: #333333;\">=<\/span> <span style=\"color: #0000dd; font-weight: bold;\">200<\/span><span style=\"color: #333333;\">;<\/span>  <span style=\"color: #888888;\">\/\/This line gives error<\/span>\r\n\t\tnewPay <span style=\"color: #333333;\">=<\/span> <span style=\"color: #0000dd; font-weight: bold;\">600<\/span><span style=\"color: #333333;\">;<\/span>  <span style=\"color: #888888;\">\/\/This line gives error<\/span>\r\n\t\tTester t <span style=\"color: #333333;\">=<\/span> <span style=\"color: #008800; font-weight: bold;\">new<\/span> Tester<span style=\"color: #333333;\">();<\/span>\r\n\t\tt<span style=\"color: #333333;\">.<\/span><span style=\"color: #0000cc;\">IncreasePay<\/span><span style=\"color: #333333;\">(<\/span><span style=\"color: #0000dd; font-weight: bold;\">1000<\/span><span style=\"color: #333333;\">);<\/span>\r\n\t<span style=\"color: #333333;\">}<\/span>\r\n<span style=\"color: #333333;\">}<\/span>\r\n<\/pre>\r\n<\/div>\r\n\r\n<p>Listing 1.0: Local variables example<\/p>\r\n\r\n\r\n\r\n<p>In Listing 1.0, variables amount and newPay are both local variables. They are only available inside the IncreasePay block. Therefore, if you try to use them inside the main method, you get an error. \u00a0<\/p>\r\n\r\n\r\n\r\n<p>&nbsp;<\/p>\r\n\r\n<h4 class=\"wp-block-heading\"><strong id=\"t2\">2. Instance Variables<\/strong><\/h4>\r\n\r\n\r\n\r\n<p>We declare instance variables inside a class. However, they must be outside a method.<\/p>\r\n\r\n\r\n\r\n<p>I provide the following properties of instance variables<\/p>\r\n\r\n\r\n\r\n<ul class=\"wp-block-list\">\r\n<li>Declared within a class<\/li>\r\n<li>Declared outside a method<\/li>\r\n<li>Also declared outside a constructor<\/li>\r\n<li>Memory is allocated for instance variables when an object is created. This is normally on the heap<\/li>\r\n<li>You create them with the &#8216;new&#8217; keyword<\/li>\r\n<li>Destroyed when the object goes out of scope<\/li>\r\n<li>You can define them using access modifiers<\/li>\r\n<li>Can be declared in class level before or after use<\/li>\r\n<li>Visible to all blocks in the class. Such as constructors and methods<\/li>\r\n<li>It&#8217;s best to declare them as private or protected<\/li>\r\n<li>They have default values. This depends of he data type.<\/li>\r\n<li>Can be accessed from within the class<\/li>\r\n<\/ul>\r\n\r\n\r\n\r\n<p>Example of instance variable is given in Listing 1.1.<\/p>\r\n<!-- HTML generated using hilite.me -->\r\n<div style=\"background: #ffffff; overflow: auto; width: auto; border: solid gray; border-width: .1em .1em .1em .8em; padding: .2em .6em;\">\r\n<pre style=\"margin: 0; line-height: 125%;\"><span style=\"color: #008800; font-weight: bold;\">public<\/span> <span style=\"color: #008800; font-weight: bold;\">class<\/span> <span style=\"color: #bb0066; font-weight: bold;\">Triangle<\/span> <span style=\"color: #333333;\">{<\/span>\r\n\t<span style=\"color: #008800; font-weight: bold;\">private<\/span> <span style=\"color: #333399; font-weight: bold;\">int<\/span> height<span style=\"color: #333333;\">;<\/span>\r\n\t<span style=\"color: #008800; font-weight: bold;\">private<\/span> <span style=\"color: #333399; font-weight: bold;\">int<\/span> base<span style=\"color: #333333;\">;<\/span>\r\n\t\r\n\t<span style=\"color: #008800; font-weight: bold;\">public<\/span> <span style=\"color: #0066bb; font-weight: bold;\">Triangle<\/span><span style=\"color: #333333;\">()<\/span> <span style=\"color: #333333;\">{<\/span> <span style=\"color: #888888;\">\/\/constructor<\/span>\r\n\t<span style=\"color: #333333;\">}<\/span>\r\n\t\r\n\t<span style=\"color: #008800; font-weight: bold;\">public<\/span> <span style=\"color: #333399; font-weight: bold;\">double<\/span> <span style=\"color: #0066bb; font-weight: bold;\">Area<\/span><span style=\"color: #333333;\">()<\/span> <span style=\"color: #333333;\">{<\/span>\r\n\t\t<span style=\"color: #333399; font-weight: bold;\">double<\/span> Area <span style=\"color: #333333;\">=<\/span> <span style=\"color: #333333;\">(<\/span><span style=\"color: #0000dd; font-weight: bold;\">1<\/span><span style=\"color: #333333;\">\/<\/span><span style=\"color: #0000dd; font-weight: bold;\">2<\/span><span style=\"color: #333333;\">)*<\/span>base<span style=\"color: #333333;\">*<\/span>height<span style=\"color: #333333;\">;<\/span>\r\n\t\t<span style=\"color: #008800; font-weight: bold;\">return<\/span> Area<span style=\"color: #333333;\">;<\/span>\r\n\t<span style=\"color: #333333;\">}<\/span>\r\n<span style=\"color: #333333;\">}<\/span>\r\n<\/pre>\r\n<\/div>\r\n\r\n<p>Listing 1.1: Example of Instance variable<\/p>\r\n\r\n\r\n\r\n<p>We see two instance variables in Listing 1.1. They are height, and base. You can see they are used inside the Area method. Also notice they are declared as private. \u00a0<\/p>\r\n\r\n\r\n\r\n<p>&nbsp;<\/p>\r\n\r\n<h4 class=\"wp-block-heading\"><strong id=\"t3\">3. Class Variables <\/strong><\/h4>\r\n\r\n\r\n\r\n<p>Also known as static variables. I provide a list of attribute for class variables below.<\/p>\r\n\r\n\r\n\r\n<ul class=\"wp-block-list\">\r\n<li>You declare them with static keyword<\/li>\r\n<li>Declare outside code block such as method and constructors<\/li>\r\n<li>There is only on copy per class.<\/li>\r\n<li>Static variables are stored in static memory.<\/li>\r\n<li>You used them in a similar way to constants.<\/li>\r\n<li>They are created when the program starts running.<\/li>\r\n<li>They are destroyed when program execution ends.<\/li>\r\n<li>You access them using the class name. For example Vehicle.make. That is &lt;class_name&gt;.&lt;variable_name)<\/li>\r\n<li>Generally declared as public.<\/li>\r\n<li>Has default values depending on the data type.<\/li>\r\n<li>They are seldom used<\/li>\r\n<\/ul>\r\n\r\n\r\n\r\n<p>I provide an example is given below. You can try to run it yourself.<\/p>\r\n<!-- HTML generated using hilite.me -->\r\n<div style=\"background: #ffffff; overflow: auto; width: auto; border: solid gray; border-width: .1em .1em .1em .8em; padding: .2em .6em;\">\r\n<pre style=\"margin: 0; line-height: 125%;\"><span style=\"color: #008800; font-weight: bold;\">public<\/span> <span style=\"color: #008800; font-weight: bold;\">class<\/span> <span style=\"color: #bb0066; font-weight: bold;\">Vehicle<\/span> <span style=\"color: #333333;\">{<\/span>\r\n\tString make<span style=\"color: #333333;\">;<\/span>\r\n\t<span style=\"color: #008800; font-weight: bold;\">public<\/span> <span style=\"color: #008800; font-weight: bold;\">static<\/span> <span style=\"color: #333399; font-weight: bold;\">int<\/span> numberOfVehicles <span style=\"color: #333333;\">=<\/span> <span style=\"color: #0000dd; font-weight: bold;\">0<\/span><span style=\"color: #333333;\">;<\/span> <span style=\"color: #888888;\">\/\/ Static Variable<\/span>\r\n\t\r\n\t<span style=\"color: #008800; font-weight: bold;\">public<\/span> <span style=\"color: #0066bb; font-weight: bold;\">Vehicle<\/span><span style=\"color: #333333;\">(<\/span>String make<span style=\"color: #333333;\">)<\/span> <span style=\"color: #333333;\">{<\/span>\r\n\t\t<span style=\"color: #008800; font-weight: bold;\">this<\/span><span style=\"color: #333333;\">.<\/span><span style=\"color: #0000cc;\">make<\/span> <span style=\"color: #333333;\">=<\/span> make<span style=\"color: #333333;\">;<\/span>\r\n\t<span style=\"color: #333333;\">}<\/span>\r\n<span style=\"color: #333333;\">}<\/span>\r\n<\/pre>\r\n<\/div>\r\n\r\n<p>Listing 1.2: Example of Static Variable<\/p>","protected":false},"excerpt":{"rendered":"<p>I&#8217;m sure you already know what a variable in Java is. Just a memory location to store values. However, you have the power to provide &hellip; <\/p>\n","protected":false},"author":395,"featured_media":46,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[2],"tags":[4],"class_list":["post-44","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-java-tutorial","tag-java-variables"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.6 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Java - Variable Types - Java Tutorials<\/title>\n<meta name=\"description\" content=\"In this Tutorial, you learn about Variables in Java. We covered, Local variables, class variables and instance variables and their properties.\" \/>\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.kindsonthegenius.com\/java\/08-java-variable-types\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Java - Variable Types - Java Tutorials\" \/>\n<meta property=\"og:description\" content=\"In this Tutorial, you learn about Variables in Java. We covered, Local variables, class variables and instance variables and their properties.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.kindsonthegenius.com\/java\/08-java-variable-types\/\" \/>\n<meta property=\"og:site_name\" content=\"Java Tutorials\" \/>\n<meta property=\"article:published_time\" content=\"2019-01-16T00:56:56+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2020-07-25T13:03:19+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.kindsonthegenius.com\/java\/wp-content\/uploads\/sites\/9\/2019\/01\/Variables-in-Java.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"950\" \/>\n\t<meta property=\"og:image:height\" content=\"518\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"kindsonthegenius\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"kindsonthegenius\" \/>\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.kindsonthegenius.com\\\/java\\\/08-java-variable-types\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.kindsonthegenius.com\\\/java\\\/08-java-variable-types\\\/\"},\"author\":{\"name\":\"kindsonthegenius\",\"@id\":\"https:\\\/\\\/www.kindsonthegenius.com\\\/java\\\/#\\\/schema\\\/person\\\/63a68934672db675ff0cd80d066510c2\"},\"headline\":\"Java &#8211; Variable Types\",\"datePublished\":\"2019-01-16T00:56:56+00:00\",\"dateModified\":\"2020-07-25T13:03:19+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.kindsonthegenius.com\\\/java\\\/08-java-variable-types\\\/\"},\"wordCount\":438,\"commentCount\":1,\"image\":{\"@id\":\"https:\\\/\\\/www.kindsonthegenius.com\\\/java\\\/08-java-variable-types\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.kindsonthegenius.com\\\/java\\\/wp-content\\\/uploads\\\/sites\\\/9\\\/2019\\\/01\\\/Variables-in-Java.jpg\",\"keywords\":[\"Java Variables\"],\"articleSection\":[\"Java Tutorial\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.kindsonthegenius.com\\\/java\\\/08-java-variable-types\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.kindsonthegenius.com\\\/java\\\/08-java-variable-types\\\/\",\"url\":\"https:\\\/\\\/www.kindsonthegenius.com\\\/java\\\/08-java-variable-types\\\/\",\"name\":\"Java - Variable Types - Java Tutorials\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.kindsonthegenius.com\\\/java\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.kindsonthegenius.com\\\/java\\\/08-java-variable-types\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.kindsonthegenius.com\\\/java\\\/08-java-variable-types\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.kindsonthegenius.com\\\/java\\\/wp-content\\\/uploads\\\/sites\\\/9\\\/2019\\\/01\\\/Variables-in-Java.jpg\",\"datePublished\":\"2019-01-16T00:56:56+00:00\",\"dateModified\":\"2020-07-25T13:03:19+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/www.kindsonthegenius.com\\\/java\\\/#\\\/schema\\\/person\\\/63a68934672db675ff0cd80d066510c2\"},\"description\":\"In this Tutorial, you learn about Variables in Java. We covered, Local variables, class variables and instance variables and their properties.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.kindsonthegenius.com\\\/java\\\/08-java-variable-types\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.kindsonthegenius.com\\\/java\\\/08-java-variable-types\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.kindsonthegenius.com\\\/java\\\/08-java-variable-types\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.kindsonthegenius.com\\\/java\\\/wp-content\\\/uploads\\\/sites\\\/9\\\/2019\\\/01\\\/Variables-in-Java.jpg\",\"contentUrl\":\"https:\\\/\\\/www.kindsonthegenius.com\\\/java\\\/wp-content\\\/uploads\\\/sites\\\/9\\\/2019\\\/01\\\/Variables-in-Java.jpg\",\"width\":950,\"height\":518,\"caption\":\"Variables in Java\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.kindsonthegenius.com\\\/java\\\/08-java-variable-types\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.kindsonthegenius.com\\\/java\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Java &#8211; Variable Types\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.kindsonthegenius.com\\\/java\\\/#website\",\"url\":\"https:\\\/\\\/www.kindsonthegenius.com\\\/java\\\/\",\"name\":\"Java Tutorials\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.kindsonthegenius.com\\\/java\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.kindsonthegenius.com\\\/java\\\/#\\\/schema\\\/person\\\/63a68934672db675ff0cd80d066510c2\",\"name\":\"kindsonthegenius\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/3079a7f663b02e801d03cd075852a037af36bd179b5fbcd0603bae3dd7833a9b?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/3079a7f663b02e801d03cd075852a037af36bd179b5fbcd0603bae3dd7833a9b?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/3079a7f663b02e801d03cd075852a037af36bd179b5fbcd0603bae3dd7833a9b?s=96&d=mm&r=g\",\"caption\":\"kindsonthegenius\"},\"url\":\"https:\\\/\\\/www.kindsonthegenius.com\\\/java\\\/author\\\/kindsonthegenius-2\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Java - Variable Types - Java Tutorials","description":"In this Tutorial, you learn about Variables in Java. We covered, Local variables, class variables and instance variables and their properties.","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.kindsonthegenius.com\/java\/08-java-variable-types\/","og_locale":"en_US","og_type":"article","og_title":"Java - Variable Types - Java Tutorials","og_description":"In this Tutorial, you learn about Variables in Java. We covered, Local variables, class variables and instance variables and their properties.","og_url":"https:\/\/www.kindsonthegenius.com\/java\/08-java-variable-types\/","og_site_name":"Java Tutorials","article_published_time":"2019-01-16T00:56:56+00:00","article_modified_time":"2020-07-25T13:03:19+00:00","og_image":[{"width":950,"height":518,"url":"https:\/\/www.kindsonthegenius.com\/java\/wp-content\/uploads\/sites\/9\/2019\/01\/Variables-in-Java.jpg","type":"image\/jpeg"}],"author":"kindsonthegenius","twitter_card":"summary_large_image","twitter_misc":{"Written by":"kindsonthegenius","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.kindsonthegenius.com\/java\/08-java-variable-types\/#article","isPartOf":{"@id":"https:\/\/www.kindsonthegenius.com\/java\/08-java-variable-types\/"},"author":{"name":"kindsonthegenius","@id":"https:\/\/www.kindsonthegenius.com\/java\/#\/schema\/person\/63a68934672db675ff0cd80d066510c2"},"headline":"Java &#8211; Variable Types","datePublished":"2019-01-16T00:56:56+00:00","dateModified":"2020-07-25T13:03:19+00:00","mainEntityOfPage":{"@id":"https:\/\/www.kindsonthegenius.com\/java\/08-java-variable-types\/"},"wordCount":438,"commentCount":1,"image":{"@id":"https:\/\/www.kindsonthegenius.com\/java\/08-java-variable-types\/#primaryimage"},"thumbnailUrl":"https:\/\/www.kindsonthegenius.com\/java\/wp-content\/uploads\/sites\/9\/2019\/01\/Variables-in-Java.jpg","keywords":["Java Variables"],"articleSection":["Java Tutorial"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.kindsonthegenius.com\/java\/08-java-variable-types\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.kindsonthegenius.com\/java\/08-java-variable-types\/","url":"https:\/\/www.kindsonthegenius.com\/java\/08-java-variable-types\/","name":"Java - Variable Types - Java Tutorials","isPartOf":{"@id":"https:\/\/www.kindsonthegenius.com\/java\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.kindsonthegenius.com\/java\/08-java-variable-types\/#primaryimage"},"image":{"@id":"https:\/\/www.kindsonthegenius.com\/java\/08-java-variable-types\/#primaryimage"},"thumbnailUrl":"https:\/\/www.kindsonthegenius.com\/java\/wp-content\/uploads\/sites\/9\/2019\/01\/Variables-in-Java.jpg","datePublished":"2019-01-16T00:56:56+00:00","dateModified":"2020-07-25T13:03:19+00:00","author":{"@id":"https:\/\/www.kindsonthegenius.com\/java\/#\/schema\/person\/63a68934672db675ff0cd80d066510c2"},"description":"In this Tutorial, you learn about Variables in Java. We covered, Local variables, class variables and instance variables and their properties.","breadcrumb":{"@id":"https:\/\/www.kindsonthegenius.com\/java\/08-java-variable-types\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.kindsonthegenius.com\/java\/08-java-variable-types\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.kindsonthegenius.com\/java\/08-java-variable-types\/#primaryimage","url":"https:\/\/www.kindsonthegenius.com\/java\/wp-content\/uploads\/sites\/9\/2019\/01\/Variables-in-Java.jpg","contentUrl":"https:\/\/www.kindsonthegenius.com\/java\/wp-content\/uploads\/sites\/9\/2019\/01\/Variables-in-Java.jpg","width":950,"height":518,"caption":"Variables in Java"},{"@type":"BreadcrumbList","@id":"https:\/\/www.kindsonthegenius.com\/java\/08-java-variable-types\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.kindsonthegenius.com\/java\/"},{"@type":"ListItem","position":2,"name":"Java &#8211; Variable Types"}]},{"@type":"WebSite","@id":"https:\/\/www.kindsonthegenius.com\/java\/#website","url":"https:\/\/www.kindsonthegenius.com\/java\/","name":"Java Tutorials","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.kindsonthegenius.com\/java\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.kindsonthegenius.com\/java\/#\/schema\/person\/63a68934672db675ff0cd80d066510c2","name":"kindsonthegenius","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/3079a7f663b02e801d03cd075852a037af36bd179b5fbcd0603bae3dd7833a9b?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/3079a7f663b02e801d03cd075852a037af36bd179b5fbcd0603bae3dd7833a9b?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/3079a7f663b02e801d03cd075852a037af36bd179b5fbcd0603bae3dd7833a9b?s=96&d=mm&r=g","caption":"kindsonthegenius"},"url":"https:\/\/www.kindsonthegenius.com\/java\/author\/kindsonthegenius-2\/"}]}},"_links":{"self":[{"href":"https:\/\/www.kindsonthegenius.com\/java\/wp-json\/wp\/v2\/posts\/44","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.kindsonthegenius.com\/java\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.kindsonthegenius.com\/java\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.kindsonthegenius.com\/java\/wp-json\/wp\/v2\/users\/395"}],"replies":[{"embeddable":true,"href":"https:\/\/www.kindsonthegenius.com\/java\/wp-json\/wp\/v2\/comments?post=44"}],"version-history":[{"count":4,"href":"https:\/\/www.kindsonthegenius.com\/java\/wp-json\/wp\/v2\/posts\/44\/revisions"}],"predecessor-version":[{"id":49,"href":"https:\/\/www.kindsonthegenius.com\/java\/wp-json\/wp\/v2\/posts\/44\/revisions\/49"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.kindsonthegenius.com\/java\/wp-json\/wp\/v2\/media\/46"}],"wp:attachment":[{"href":"https:\/\/www.kindsonthegenius.com\/java\/wp-json\/wp\/v2\/media?parent=44"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.kindsonthegenius.com\/java\/wp-json\/wp\/v2\/categories?post=44"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.kindsonthegenius.com\/java\/wp-json\/wp\/v2\/tags?post=44"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}