{"id":1045,"date":"2023-05-21T05:33:17","date_gmt":"2023-05-21T05:33:17","guid":{"rendered":"https:\/\/itnotes.apjsoftwares.com\/?p=1045"},"modified":"2023-05-21T05:33:51","modified_gmt":"2023-05-21T05:33:51","slug":"what-is-meant-by-overloading","status":"publish","type":"post","link":"https:\/\/itnotes.apjsoftwares.in\/index.php\/2023\/05\/21\/what-is-meant-by-overloading\/","title":{"rendered":"What is meant by Overloading?"},"content":{"rendered":"\n<p>Method overloading happens for different classes or within the same class.<\/p>\n\n\n\n<p><strong>For method overloading, sub-class method should satisfy the below conditions with the Super-class method (or) methods in the same class itself:<\/strong><\/p>\n\n\n\n<ul>\n<li>Same method name<\/li>\n\n\n\n<li>Different argument types<\/li>\n\n\n\n<li>There may be different return types<\/li>\n<\/ul>\n\n\n\n<p>Example:<\/p>\n\n\n\n<p>public class Manipulation{ \/\/Super class<br>public void add(String name){ \/\/String parameter<br>\u2026\u2026\u2026\u2026\u2026\u2026<br>}<br>}<\/p>\n\n\n\n<p>Public class Addition extends Manipulation(){<br>Public void add(){\/\/No Parameter<br>\u2026\u2026\u2026..<br>}<br>Public void add(int a){ \/\/integer parameter<\/p>\n\n\n\n<p>}<br>Public static void main(String args[]){<br>Addition addition = new Addition();<br>addition.add();<br>}<br>}<br>Here the add() method has different parameters in the Addition class is overloaded in the same class as with the super-class.<\/p>\n\n\n\n<p>Note: Polymorphism is not applicable for method overloading.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Method overloading happens for different classes or within the same class. For method overloading, sub-class&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[18],"tags":[],"_links":{"self":[{"href":"https:\/\/itnotes.apjsoftwares.in\/index.php\/wp-json\/wp\/v2\/posts\/1045"}],"collection":[{"href":"https:\/\/itnotes.apjsoftwares.in\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/itnotes.apjsoftwares.in\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/itnotes.apjsoftwares.in\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/itnotes.apjsoftwares.in\/index.php\/wp-json\/wp\/v2\/comments?post=1045"}],"version-history":[{"count":2,"href":"https:\/\/itnotes.apjsoftwares.in\/index.php\/wp-json\/wp\/v2\/posts\/1045\/revisions"}],"predecessor-version":[{"id":1047,"href":"https:\/\/itnotes.apjsoftwares.in\/index.php\/wp-json\/wp\/v2\/posts\/1045\/revisions\/1047"}],"wp:attachment":[{"href":"https:\/\/itnotes.apjsoftwares.in\/index.php\/wp-json\/wp\/v2\/media?parent=1045"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/itnotes.apjsoftwares.in\/index.php\/wp-json\/wp\/v2\/categories?post=1045"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/itnotes.apjsoftwares.in\/index.php\/wp-json\/wp\/v2\/tags?post=1045"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}