{"id":1049,"date":"2023-05-21T05:38:56","date_gmt":"2023-05-21T05:38:56","guid":{"rendered":"https:\/\/itnotes.apjsoftwares.com\/?p=1049"},"modified":"2023-05-21T05:39:48","modified_gmt":"2023-05-21T05:39:48","slug":"what-is-meant-by-interface","status":"publish","type":"post","link":"https:\/\/itnotes.apjsoftwares.in\/index.php\/2023\/05\/21\/what-is-meant-by-interface\/","title":{"rendered":"What is meant by Interface?"},"content":{"rendered":"\n<p>Multiple inheritances cannot be achieved in java. To overcome this problem the Interface concept is introduced.<\/p>\n\n\n\n<p>An interface is a template which has only method declarations and not the method implementation.<\/p>\n\n\n\n<p>Example:<\/p>\n\n\n\n<p>Public abstract interface IManupulation{ \/\/Interface declaration<br>Public abstract void add();\/\/method declaration<br>public abstract void subtract();<br>}<\/p>\n\n\n\n<ul>\n<li>All the methods in the interface are internally&nbsp;<strong>public abstract void<\/strong>.<\/li>\n\n\n\n<li>All the variables in the interface are internally&nbsp;<strong>public static final<\/strong>&nbsp;that is constants.<\/li>\n\n\n\n<li>Classes can implement the interface and not extends.<\/li>\n\n\n\n<li>The class which implements the interface should provide an implementation for all the methods declared in the interface.<\/li>\n<\/ul>\n\n\n\n<p>public class Manupulation implements IManupulation{ \/\/Manupulation class uses the interface<br>Public void add(){<br>\u2026\u2026\u2026\u2026\u2026<br>}<br>Public void subtract(){<br>\u2026\u2026\u2026\u2026\u2026.<br>}<br>}<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Multiple inheritances cannot be achieved in java. To overcome this problem the Interface concept is&#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\/1049"}],"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=1049"}],"version-history":[{"count":2,"href":"https:\/\/itnotes.apjsoftwares.in\/index.php\/wp-json\/wp\/v2\/posts\/1049\/revisions"}],"predecessor-version":[{"id":1051,"href":"https:\/\/itnotes.apjsoftwares.in\/index.php\/wp-json\/wp\/v2\/posts\/1049\/revisions\/1051"}],"wp:attachment":[{"href":"https:\/\/itnotes.apjsoftwares.in\/index.php\/wp-json\/wp\/v2\/media?parent=1049"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/itnotes.apjsoftwares.in\/index.php\/wp-json\/wp\/v2\/categories?post=1049"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/itnotes.apjsoftwares.in\/index.php\/wp-json\/wp\/v2\/tags?post=1049"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}