{"id":1039,"date":"2023-05-21T05:25:08","date_gmt":"2023-05-21T05:25:08","guid":{"rendered":"https:\/\/itnotes.apjsoftwares.com\/?p=1039"},"modified":"2023-05-21T05:25:39","modified_gmt":"2023-05-21T05:25:39","slug":"what-is-polymorphism","status":"publish","type":"post","link":"https:\/\/itnotes.apjsoftwares.in\/index.php\/2023\/05\/21\/what-is-polymorphism\/","title":{"rendered":"What is Polymorphism?"},"content":{"rendered":"\n<p>Polymorphism means many forms.<\/p>\n\n\n\n<p>A single object can refer to the super-class or sub-class depending on the reference type which is called polymorphism.<\/p>\n\n\n\n<p><strong>Example:<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td><code>Public class Manipulation(){ <\/code><br><code>\/\/Super class <\/code><br><code>public void add(){<\/code><br><code>}<\/code><br><code>}<\/code><br><code>public class Addition extendsManipulation(){<\/code><br><code> \/\/ Sub class <\/code><br><code>public void add(){<\/code><br><code>}<\/code><br><code>public static void main(String args[]){<\/code><br><code>Manipulation addition = newAddition();\/\/Manipulation is reference type and Addition is reference typeaddition.add();<\/code><br><code>}<\/code><br><code>}<\/code><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>Using the Manipulation reference type we can call the Addition class \u201cadd()\u201d method. This ability is known as Polymorphism. Polymorphism is applicable for\u00a0<strong>overriding\u00a0<\/strong>and not for\u00a0<strong>overloading<\/strong>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Polymorphism means many forms. A single object can refer to the super-class or sub-class depending&#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\/1039"}],"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=1039"}],"version-history":[{"count":2,"href":"https:\/\/itnotes.apjsoftwares.in\/index.php\/wp-json\/wp\/v2\/posts\/1039\/revisions"}],"predecessor-version":[{"id":1041,"href":"https:\/\/itnotes.apjsoftwares.in\/index.php\/wp-json\/wp\/v2\/posts\/1039\/revisions\/1041"}],"wp:attachment":[{"href":"https:\/\/itnotes.apjsoftwares.in\/index.php\/wp-json\/wp\/v2\/media?parent=1039"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/itnotes.apjsoftwares.in\/index.php\/wp-json\/wp\/v2\/categories?post=1039"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/itnotes.apjsoftwares.in\/index.php\/wp-json\/wp\/v2\/tags?post=1039"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}