{"id":7771,"date":"2020-02-26T00:02:14","date_gmt":"2020-02-25T18:32:14","guid":{"rendered":"https:\/\/tutorials.eyehunts.com\/?p=7771"},"modified":"2021-10-22T18:32:46","modified_gmt":"2021-10-22T13:02:46","slug":"when-to-use-static-methods-in-java-examples","status":"publish","type":"post","link":"https:\/\/tutorial.eyehunts.com\/python\/when-to-use-static-methods-in-java-examples\/","title":{"rendered":"When to use static methods in Java | How to use &#038; examples"},"content":{"rendered":"\n<p>A Static method is declared with the <a href=\"https:\/\/tutorial.eyehunts.com\/\/java\/static-keyword-in-java-method-variable-block-nested-class-examples\/\">static keyword<\/a>. Making a static method in java required when you don&#8217;t want a create an object or method is not using any instance variable or method definition will not change or can&#8217;t be <a rel=\"noreferrer noopener\" aria-label=\"overridden (opens in a new tab)\" href=\"https:\/\/tutorial.eyehunts.com\/\/java\/override-java-equals-method-overriding\/\" target=\"_blank\">overridden<\/a>. This is some reason when to use static methods in java.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large is-resized\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/tutorial.eyehunts.com\/\/wp-content\/uploads\/2020\/02\/When-to-use-static-methods.png?resize=546%2C212&#038;ssl=1\" alt=\"When to use static methods \" class=\"wp-image-7783\" width=\"546\" height=\"212\" srcset=\"https:\/\/i0.wp.com\/tutorial.eyehunts.com\/wp-content\/uploads\/2020\/02\/When-to-use-static-methods.png?w=982&amp;ssl=1 982w, https:\/\/i0.wp.com\/tutorial.eyehunts.com\/wp-content\/uploads\/2020\/02\/When-to-use-static-methods.png?resize=300%2C117&amp;ssl=1 300w, https:\/\/i0.wp.com\/tutorial.eyehunts.com\/wp-content\/uploads\/2020\/02\/When-to-use-static-methods.png?resize=768%2C299&amp;ssl=1 768w\" sizes=\"auto, (max-width: 546px) 100vw, 546px\" \/><\/figure><\/div>\n\n\n\n<p>It&#8217;s an interview question and many programmers can get confused to make a particular method static or not. The main advantage of the static method is you can call it without creating any <a rel=\"noreferrer noopener\" aria-label=\" (opens in a new tab)\" href=\"https:\/\/tutorial.eyehunts.com\/\/python\/python-classes-create-objects-exercise\/\" target=\"_blank\">class object<\/a>. So if you want the direct call to a method, then make a static method.<\/p>\n\n\n\n<p><strong>Note:<\/strong> The&nbsp;<strong>main method in java<\/strong>&nbsp;itself is a&nbsp;<strong>static method<\/strong>.<\/p>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">When to use static methods in Java?<\/h2>\n\n\n\n<p>Define static methods in the following scenarios only:<\/p>\n\n\n\n<ol class=\"wp-block-list\"><li>If writing utility classes and they are not supposed to be changed. ( e.g.\u00a0<strong>java.lang.Math<\/strong>\u00a0or\u00a0<strong>StringUtils<\/strong> are good examples of classes, which use static methods).<\/li><li>If the method is not using any instance variable.<\/li><li>If any operation is not dependent on instance creation.<\/li><li>If there is some code that can easily be shared by all the instance methods, extract that code into a static method.<\/li><li>When the definition of the method will never be changed or overridden. Static methods can not be overridden.<\/li><li>Along with creational design patterns e.g. Factory and Singleton.<\/li><li>A conversion tool e.g.\u00a0valueOf()<\/li><\/ol>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Conditions make a method static in Java:-<\/strong><\/h2>\n\n\n\n<p>Here is some condition when you can decide to make a static method. Based on our experiences, which helps to make a method static and also teaches when to use the static method in Java.<\/p>\n\n\n\n<ol class=\"wp-block-list\"><li>If your method doesn&#8217;t modify the state of the <a rel=\"noreferrer noopener\" aria-label=\"object (opens in a new tab)\" href=\"https:\/\/tutorial.eyehunts.com\/\/java\/java-object-class-array-clone-copy-example\/\" target=\"_blank\">object<\/a>, or not using&nbsp;any&nbsp;<a rel=\"noreferrer noopener\" aria-label=\"instance variables (opens in a new tab)\" href=\"https:\/\/tutorial.eyehunts.com\/\/java\/java-variables-declaration-types-scope\/\" target=\"_blank\">instance variables<\/a>.<\/li><li>Call method without creating a <a rel=\"noreferrer noopener\" aria-label=\"class object (opens in a new tab)\" href=\"https:\/\/tutorial.eyehunts.com\/\/java\/java-object-class-array-clone-copy-example\/\" target=\"_blank\">class object<\/a>.<\/li><li>Creating Utility methods&nbsp;like- <strong>StringUtils.isEmpty(String text)<\/strong><\/li><\/ol>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">Example<\/h2>\n\n\n\n<pre>\npublic class Hello {\n\n    public static void main(String args[]) {\n        \/\/ calling static method without creating object. \n        display();\n    }\n\n    static void display()\n    {\n        System.out.println(\"Hello static method\");\n    }\n}\n<\/pre>\n\n\n\n<p><strong>Output:<\/strong> Hello static method<\/p>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Restrictions for the static method<\/strong><\/h2>\n\n\n\n<p>There are two main restrictions for the static method:-<\/p>\n\n\n\n<ol class=\"wp-block-list\"><li>The static method can not use non-static data members or call the non-static method directly.<\/li><li>this and super cannot be used in a static context.<\/li><\/ol>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p>Do comment if you have any doubts and suggestions on this tutorial.<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p><strong>Note:<\/strong>&nbsp;This example (Project) is developed in IntelliJ IDEA 2018.2.6 (Community Edition)<br>JRE: 11.0.1<br>JVM:&nbsp;<a href=\"https:\/\/openjdk.java.net\/\">OpenJDK<\/a>&nbsp;64-Bit Server VM by JetBrains s.r.o<br>macOS 10.14.1<br><strong>Java version 11<\/strong><br>All&nbsp;<strong>Java static methods in java codes<\/strong>&nbsp;are&nbsp;in Java 11, so it may change on different from Java 9 or 10 or upgraded versions.<\/p><\/blockquote>\n","protected":false},"excerpt":{"rendered":"<p>A Static method is declared with the static keyword. Making a static method in java required when you don&#8217;t want a create an object or method is not using any instance variable or method definition will not change or can&#8217;t be overridden. This is some reason when to use static methods in java. It&#8217;s an&hellip;&nbsp;<a href=\"https:\/\/tutorial.eyehunts.com\/python\/when-to-use-static-methods-in-java-examples\/\" rel=\"bookmark\">Read More &raquo;<span class=\"screen-reader-text\">When to use static methods in Java | How to use &#038; examples<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"neve_meta_sidebar":"","neve_meta_container":"","neve_meta_enable_content_width":"","neve_meta_content_width":0,"neve_meta_title_alignment":"","neve_meta_author_avatar":"","neve_post_elements_order":"","neve_meta_disable_header":"","neve_meta_disable_footer":"","neve_meta_disable_title":"","jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[30],"tags":[85],"post_series":[],"class_list":["post-7771","post","type-post","status-publish","format-standard","hentry","category-python","tag-java-questions"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.1.1 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>When to use static methods in Java | How to use &amp; examples - EyeHunts<\/title>\n<meta name=\"description\" content=\"A Static method is declared with the static keyword. Making a static method in java required when you don&#039;t want a create an object or method is not using..\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/tutorial.eyehunts.com\/python\/when-to-use-static-methods-in-java-examples\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"When to use static methods in Java | How to use &amp; examples - EyeHunts\" \/>\n<meta property=\"og:description\" content=\"A Static method is declared with the static keyword. Making a static method in java required when you don&#039;t want a create an object or method is not using..\" \/>\n<meta property=\"og:url\" content=\"https:\/\/tutorial.eyehunts.com\/python\/when-to-use-static-methods-in-java-examples\/\" \/>\n<meta property=\"og:site_name\" content=\"Tutorial\" \/>\n<meta property=\"article:published_time\" content=\"2020-02-25T18:32:14+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-10-22T13:02:46+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/tutorial.eyehunts.com\/\/wp-content\/uploads\/2020\/02\/When-to-use-static-methods.png\" \/>\n<meta name=\"author\" content=\"Rohit\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Rohit\" \/>\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\":\"WebPage\",\"@id\":\"https:\/\/tutorial.eyehunts.com\/python\/when-to-use-static-methods-in-java-examples\/\",\"url\":\"https:\/\/tutorial.eyehunts.com\/python\/when-to-use-static-methods-in-java-examples\/\",\"name\":\"When to use static methods in Java | How to use & examples - EyeHunts\",\"isPartOf\":{\"@id\":\"https:\/\/tutorial.eyehunts.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/tutorial.eyehunts.com\/python\/when-to-use-static-methods-in-java-examples\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/tutorial.eyehunts.com\/python\/when-to-use-static-methods-in-java-examples\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/tutorial.eyehunts.com\/\/wp-content\/uploads\/2020\/02\/When-to-use-static-methods.png\",\"datePublished\":\"2020-02-25T18:32:14+00:00\",\"dateModified\":\"2021-10-22T13:02:46+00:00\",\"author\":{\"@id\":\"https:\/\/tutorial.eyehunts.com\/#\/schema\/person\/69ca2cb8c13fdce0ee5b39d6175119b1\"},\"description\":\"A Static method is declared with the static keyword. Making a static method in java required when you don't want a create an object or method is not using..\",\"breadcrumb\":{\"@id\":\"https:\/\/tutorial.eyehunts.com\/python\/when-to-use-static-methods-in-java-examples\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/tutorial.eyehunts.com\/python\/when-to-use-static-methods-in-java-examples\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/tutorial.eyehunts.com\/python\/when-to-use-static-methods-in-java-examples\/#primaryimage\",\"url\":\"https:\/\/tutorial.eyehunts.com\/\/wp-content\/uploads\/2020\/02\/When-to-use-static-methods.png\",\"contentUrl\":\"https:\/\/tutorial.eyehunts.com\/\/wp-content\/uploads\/2020\/02\/When-to-use-static-methods.png\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/tutorial.eyehunts.com\/python\/when-to-use-static-methods-in-java-examples\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/tutorial.eyehunts.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"When to use static methods in Java | How to use &#038; examples\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/tutorial.eyehunts.com\/#website\",\"url\":\"https:\/\/tutorial.eyehunts.com\/\",\"name\":\"Tutorial\",\"description\":\"By EyeHunts\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/tutorial.eyehunts.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/tutorial.eyehunts.com\/#\/schema\/person\/69ca2cb8c13fdce0ee5b39d6175119b1\",\"name\":\"Rohit\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/tutorial.eyehunts.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/tutorial.eyehunts.com\/wp-content\/litespeed\/avatar\/2b27529b86d6dfb5336897e07c93a827.jpg?ver=1777374971\",\"contentUrl\":\"https:\/\/tutorial.eyehunts.com\/wp-content\/litespeed\/avatar\/2b27529b86d6dfb5336897e07c93a827.jpg?ver=1777374971\",\"caption\":\"Rohit\"},\"description\":\"Degree in Computer Science and Engineer: App Developer and has multiple Programming languages experience. Enthusiasm for technology &amp; like learning technical.\",\"url\":\"https:\/\/tutorial.eyehunts.com\/author\/rohit\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"When to use static methods in Java | How to use & examples - EyeHunts","description":"A Static method is declared with the static keyword. Making a static method in java required when you don't want a create an object or method is not using..","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:\/\/tutorial.eyehunts.com\/python\/when-to-use-static-methods-in-java-examples\/","og_locale":"en_US","og_type":"article","og_title":"When to use static methods in Java | How to use & examples - EyeHunts","og_description":"A Static method is declared with the static keyword. Making a static method in java required when you don't want a create an object or method is not using..","og_url":"https:\/\/tutorial.eyehunts.com\/python\/when-to-use-static-methods-in-java-examples\/","og_site_name":"Tutorial","article_published_time":"2020-02-25T18:32:14+00:00","article_modified_time":"2021-10-22T13:02:46+00:00","og_image":[{"url":"https:\/\/tutorial.eyehunts.com\/\/wp-content\/uploads\/2020\/02\/When-to-use-static-methods.png","type":"","width":"","height":""}],"author":"Rohit","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Rohit","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/tutorial.eyehunts.com\/python\/when-to-use-static-methods-in-java-examples\/","url":"https:\/\/tutorial.eyehunts.com\/python\/when-to-use-static-methods-in-java-examples\/","name":"When to use static methods in Java | How to use & examples - EyeHunts","isPartOf":{"@id":"https:\/\/tutorial.eyehunts.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/tutorial.eyehunts.com\/python\/when-to-use-static-methods-in-java-examples\/#primaryimage"},"image":{"@id":"https:\/\/tutorial.eyehunts.com\/python\/when-to-use-static-methods-in-java-examples\/#primaryimage"},"thumbnailUrl":"https:\/\/tutorial.eyehunts.com\/\/wp-content\/uploads\/2020\/02\/When-to-use-static-methods.png","datePublished":"2020-02-25T18:32:14+00:00","dateModified":"2021-10-22T13:02:46+00:00","author":{"@id":"https:\/\/tutorial.eyehunts.com\/#\/schema\/person\/69ca2cb8c13fdce0ee5b39d6175119b1"},"description":"A Static method is declared with the static keyword. Making a static method in java required when you don't want a create an object or method is not using..","breadcrumb":{"@id":"https:\/\/tutorial.eyehunts.com\/python\/when-to-use-static-methods-in-java-examples\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/tutorial.eyehunts.com\/python\/when-to-use-static-methods-in-java-examples\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/tutorial.eyehunts.com\/python\/when-to-use-static-methods-in-java-examples\/#primaryimage","url":"https:\/\/tutorial.eyehunts.com\/\/wp-content\/uploads\/2020\/02\/When-to-use-static-methods.png","contentUrl":"https:\/\/tutorial.eyehunts.com\/\/wp-content\/uploads\/2020\/02\/When-to-use-static-methods.png"},{"@type":"BreadcrumbList","@id":"https:\/\/tutorial.eyehunts.com\/python\/when-to-use-static-methods-in-java-examples\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/tutorial.eyehunts.com\/"},{"@type":"ListItem","position":2,"name":"When to use static methods in Java | How to use &#038; examples"}]},{"@type":"WebSite","@id":"https:\/\/tutorial.eyehunts.com\/#website","url":"https:\/\/tutorial.eyehunts.com\/","name":"Tutorial","description":"By EyeHunts","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/tutorial.eyehunts.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/tutorial.eyehunts.com\/#\/schema\/person\/69ca2cb8c13fdce0ee5b39d6175119b1","name":"Rohit","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/tutorial.eyehunts.com\/#\/schema\/person\/image\/","url":"https:\/\/tutorial.eyehunts.com\/wp-content\/litespeed\/avatar\/2b27529b86d6dfb5336897e07c93a827.jpg?ver=1777374971","contentUrl":"https:\/\/tutorial.eyehunts.com\/wp-content\/litespeed\/avatar\/2b27529b86d6dfb5336897e07c93a827.jpg?ver=1777374971","caption":"Rohit"},"description":"Degree in Computer Science and Engineer: App Developer and has multiple Programming languages experience. Enthusiasm for technology &amp; like learning technical.","url":"https:\/\/tutorial.eyehunts.com\/author\/rohit\/"}]}},"jetpack_featured_media_url":"","jetpack-related-posts":[{"id":6681,"url":"https:\/\/tutorial.eyehunts.com\/java\/java-static-method-class-interface-call-example\/","url_meta":{"origin":7771,"position":0},"title":"Java static method | Class, Interface, call Example","author":"Rohit","date":"July 31, 2019","format":false,"excerpt":"A Java static method belongs to the class and not to the object (instance). You have to use Static Keyword to create static methods in Java. A static method can access only static data. Points to remember about the Static method in java:- A static method belongs to the class\u2026","rel":"","context":"In &quot;Java&quot;","block_context":{"text":"Java","link":"https:\/\/tutorial.eyehunts.com\/category\/java\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/tutorial.eyehunts.com\/wp-content\/uploads\/2019\/07\/Java-static-method.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/tutorial.eyehunts.com\/wp-content\/uploads\/2019\/07\/Java-static-method.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/tutorial.eyehunts.com\/wp-content\/uploads\/2019\/07\/Java-static-method.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/tutorial.eyehunts.com\/wp-content\/uploads\/2019\/07\/Java-static-method.png?resize=700%2C400&ssl=1 2x, https:\/\/i0.wp.com\/tutorial.eyehunts.com\/wp-content\/uploads\/2019\/07\/Java-static-method.png?resize=1050%2C600&ssl=1 3x"},"classes":[]},{"id":3794,"url":"https:\/\/tutorial.eyehunts.com\/java\/static-keyword-in-java-method-variable-block-nested-class-examples\/","url_meta":{"origin":7771,"position":1},"title":"Static keyword in Java | Method, Variable, Block, Nested Class with Examples","author":"Rohit","date":"July 24, 2019","format":false,"excerpt":"What is Static Keyword in java? A Static keyword is used in java for application memory management. You can apply static keywords in variables, methods, blocks, and nested classes. Static means that you don't have to create an instance of the class to use the methods or variables associated with\u2026","rel":"","context":"In &quot;Java&quot;","block_context":{"text":"Java","link":"https:\/\/tutorial.eyehunts.com\/category\/java\/"},"img":{"alt_text":"Static keyword in Java Method, Variable, Block, Nested Class","src":"https:\/\/i0.wp.com\/tutorial.eyehunts.com\/wp-content\/uploads\/2019\/07\/Static-keyword-in-Java-Method-Variable-Block-Nested-Class.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/tutorial.eyehunts.com\/wp-content\/uploads\/2019\/07\/Static-keyword-in-Java-Method-Variable-Block-Nested-Class.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/tutorial.eyehunts.com\/wp-content\/uploads\/2019\/07\/Static-keyword-in-Java-Method-Variable-Block-Nested-Class.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/tutorial.eyehunts.com\/wp-content\/uploads\/2019\/07\/Static-keyword-in-Java-Method-Variable-Block-Nested-Class.png?resize=700%2C400&ssl=1 2x"},"classes":[]},{"id":3932,"url":"https:\/\/tutorial.eyehunts.com\/java\/java-main-method-syntax-signature-static\/","url_meta":{"origin":7771,"position":2},"title":"Java main method | Syntax &#038; Signature | Static","author":"Rohit","date":"January 10, 2019","format":false,"excerpt":"Java's main method is the most important method in Java application or program. When you started\u00a0the first program, you used the main method in code. Do check again the First Java Program - \"Hello World\". You can write an in the main method or any other method? Anything which you\u2026","rel":"","context":"In &quot;Java&quot;","block_context":{"text":"Java","link":"https:\/\/tutorial.eyehunts.com\/category\/java\/"},"img":{"alt_text":"Java main method Syntax & Signature Static","src":"https:\/\/i0.wp.com\/tutorial.eyehunts.com\/\/wp-content\/uploads\/2019\/01\/Java-main-method-Syntax-Signature-Static.png?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":3649,"url":"https:\/\/tutorial.eyehunts.com\/java\/java-overloading-method-overload-example\/","url_meta":{"origin":7771,"position":3},"title":"Java Overloading | Method overloading | Examples","author":"Rohit","date":"December 19, 2018","format":false,"excerpt":"Java Overloading\u00a0is defining two or more methods with the same name. But Method overloading in Java\u00a0has the same name with\u00a0a different number of parameters, different types of parameters, or both.\u00a0 Methods overloading comes under the Polymorphism OOPs Concept. And it's also called compile-time (or static) polymorphism. Syntax The syntax of\u2026","rel":"","context":"In &quot;Java&quot;","block_context":{"text":"Java","link":"https:\/\/tutorial.eyehunts.com\/category\/java\/"},"img":{"alt_text":"Java Overloading, Method overloading Examples constructor rules","src":"https:\/\/i0.wp.com\/tutorial.eyehunts.com\/wp-content\/uploads\/2018\/12\/Java-Overloading-Method-overloading-Examples-constructor-rules.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/tutorial.eyehunts.com\/wp-content\/uploads\/2018\/12\/Java-Overloading-Method-overloading-Examples-constructor-rules.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/tutorial.eyehunts.com\/wp-content\/uploads\/2018\/12\/Java-Overloading-Method-overloading-Examples-constructor-rules.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/tutorial.eyehunts.com\/wp-content\/uploads\/2018\/12\/Java-Overloading-Method-overloading-Examples-constructor-rules.png?resize=700%2C400&ssl=1 2x"},"classes":[]},{"id":3208,"url":"https:\/\/tutorial.eyehunts.com\/java\/java-methods-type-calling-parameter-method\/","url_meta":{"origin":7771,"position":4},"title":"Java Methods | Types | Calling &#038; Parameters Methods example","author":"Rohit","date":"November 26, 2018","format":false,"excerpt":"A Java Methods or Function is a group of the statement, which performs a particular\u00a0operation. You can also call it's a piece of code with its own functionally, and make your application\u00a0code more neat and clean. Don't confuse with methods and Functions, both are the same. The different-different programming language\u00a0used\u2026","rel":"","context":"In &quot;Java&quot;","block_context":{"text":"Java","link":"https:\/\/tutorial.eyehunts.com\/category\/java\/"},"img":{"alt_text":"Java Methods Types Calling & Parameters Methods example","src":"https:\/\/i0.wp.com\/tutorial.eyehunts.com\/wp-content\/uploads\/2018\/11\/Java-Methods-Types-Calling-Parameters-Methods-example.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/tutorial.eyehunts.com\/wp-content\/uploads\/2018\/11\/Java-Methods-Types-Calling-Parameters-Methods-example.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/tutorial.eyehunts.com\/wp-content\/uploads\/2018\/11\/Java-Methods-Types-Calling-Parameters-Methods-example.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/tutorial.eyehunts.com\/wp-content\/uploads\/2018\/11\/Java-Methods-Types-Calling-Parameters-Methods-example.png?resize=700%2C400&ssl=1 2x"},"classes":[]},{"id":3610,"url":"https:\/\/tutorial.eyehunts.com\/java\/java-interface-definition-method-implement\/","url_meta":{"origin":7771,"position":5},"title":"Java Interface | Definition, Use, Methods | What is ? How to implement Example","author":"Rohit","date":"December 17, 2018","format":false,"excerpt":"Java interface definition (What is an interface) Java interface provides\u00a0100% abstraction. The interface also has methods and variables same as a class but\u00a0methods are by default abstract. Mends no Body or sentence in the method the only declaration. And Variables in Interface are constant, which means\u00a0fields are public, static, and\u2026","rel":"","context":"In &quot;Java&quot;","block_context":{"text":"Java","link":"https:\/\/tutorial.eyehunts.com\/category\/java\/"},"img":{"alt_text":"Java Interface Definition, Use, Methods What is ? How to implement Example","src":"https:\/\/i0.wp.com\/tutorial.eyehunts.com\/wp-content\/uploads\/2018\/12\/Java-Interface-Definition-Use-Methods-What-is-How-to-implement-Example.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/tutorial.eyehunts.com\/wp-content\/uploads\/2018\/12\/Java-Interface-Definition-Use-Methods-What-is-How-to-implement-Example.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/tutorial.eyehunts.com\/wp-content\/uploads\/2018\/12\/Java-Interface-Definition-Use-Methods-What-is-How-to-implement-Example.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/tutorial.eyehunts.com\/wp-content\/uploads\/2018\/12\/Java-Interface-Definition-Use-Methods-What-is-How-to-implement-Example.png?resize=700%2C400&ssl=1 2x"},"classes":[]}],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/tutorial.eyehunts.com\/wp-json\/wp\/v2\/posts\/7771","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/tutorial.eyehunts.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/tutorial.eyehunts.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/tutorial.eyehunts.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/tutorial.eyehunts.com\/wp-json\/wp\/v2\/comments?post=7771"}],"version-history":[{"count":1,"href":"https:\/\/tutorial.eyehunts.com\/wp-json\/wp\/v2\/posts\/7771\/revisions"}],"predecessor-version":[{"id":21455,"href":"https:\/\/tutorial.eyehunts.com\/wp-json\/wp\/v2\/posts\/7771\/revisions\/21455"}],"wp:attachment":[{"href":"https:\/\/tutorial.eyehunts.com\/wp-json\/wp\/v2\/media?parent=7771"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/tutorial.eyehunts.com\/wp-json\/wp\/v2\/categories?post=7771"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/tutorial.eyehunts.com\/wp-json\/wp\/v2\/tags?post=7771"},{"taxonomy":"post_series","embeddable":true,"href":"https:\/\/tutorial.eyehunts.com\/wp-json\/wp\/v2\/post_series?post=7771"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}