{"id":2144,"date":"2020-03-17T17:04:51","date_gmt":"2020-03-17T17:04:51","guid":{"rendered":"https:\/\/www.h2kinfosys.com\/blog\/?p=2144"},"modified":"2024-12-28T10:16:06","modified_gmt":"2024-12-28T15:16:06","slug":"inheritance-in-java","status":"publish","type":"post","link":"https:\/\/www.h2kinfosys.com\/blog\/inheritance-in-java\/","title":{"rendered":"Inheritance in Java | Types and Examples"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\"><b>Introduction <\/b><\/h2>\n\n\n\n<p><span style=\"font-weight: 400;\">Inheritance in java is a mechanism where one class acquires all the properties and behaviors of another class. The main advantage of Inheritance is reusability; we can use fields and methods of the parent class. We use Inheritance, where an &#8220;Is-A&#8221; relationship is present between two classes. The parent <a href=\"https:\/\/www.h2kinfosys.com\/blog\/nested-classes-in-java\/\">class in java<\/a> is denoted as a superclass, whereas the inherited class is denoted as a subclass. We use the keyword extends to inherit the features of the superclass in the subclass.<\/span><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><b>Types of Inheritance<\/b><\/h2>\n\n\n\n<p><span style=\"font-weight: 400;\">There are several types of Inheritance:<\/span><\/p>\n\n\n\n<p><span style=\"font-weight: 400;\">1] Single Inheritance: In this inheritance, one class acquires the property of another class.<\/span><\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img fetchpriority=\"high\" decoding=\"async\" width=\"652\" height=\"358\" src=\"https:\/\/www.h2kinfosys.com\/blog\/wp-content\/uploads\/2020\/03\/Screenshot_1-2.png\" alt=\"inheritance in java\" class=\"wp-image-2145\" title=\"\" srcset=\"https:\/\/www.h2kinfosys.com\/blog\/wp-content\/uploads\/2020\/03\/Screenshot_1-2.png 652w, https:\/\/www.h2kinfosys.com\/blog\/wp-content\/uploads\/2020\/03\/Screenshot_1-2-300x165.png 300w\" sizes=\"(max-width: 652px) 100vw, 652px\" \/><\/figure>\n<\/div>\n\n\n<p><\/p>\n\n\n\n<p><span style=\"font-weight: 400;\">2] Multiple Inheritance: In this inheritance, one class acquires the property of more than one class. Java does not support Multiple Inheritance. In java, multiple inheritance can be obtained with the help of an interface only.<\/span><\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img decoding=\"async\" width=\"633\" height=\"360\" src=\"https:\/\/www.h2kinfosys.com\/blog\/wp-content\/uploads\/2020\/03\/Screenshot_2-2.png\" alt=\"Multiple Inheritance in java\" class=\"wp-image-2146\" title=\"\" srcset=\"https:\/\/www.h2kinfosys.com\/blog\/wp-content\/uploads\/2020\/03\/Screenshot_2-2.png 633w, https:\/\/www.h2kinfosys.com\/blog\/wp-content\/uploads\/2020\/03\/Screenshot_2-2-300x171.png 300w\" sizes=\"(max-width: 633px) 100vw, 633px\" \/><\/figure>\n<\/div>\n\n\n<p><span style=\"font-weight: 400;\">3] Multilevel Inheritance: A chain of inheritance is called multilevel inheritance.<\/span><\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img decoding=\"async\" width=\"474\" height=\"418\" src=\"https:\/\/www.h2kinfosys.com\/blog\/wp-content\/uploads\/2020\/03\/Screenshot_3-2.png\" alt=\"Multilevel Inheritance in jsvs\" class=\"wp-image-2147\" title=\"\" srcset=\"https:\/\/www.h2kinfosys.com\/blog\/wp-content\/uploads\/2020\/03\/Screenshot_3-2.png 474w, https:\/\/www.h2kinfosys.com\/blog\/wp-content\/uploads\/2020\/03\/Screenshot_3-2-300x265.png 300w\" sizes=\"(max-width: 474px) 100vw, 474px\" \/><\/figure>\n<\/div>\n\n\n<p><\/p>\n\n\n\n<p><span style=\"font-weight: 400;\">4] Hierarchical Inheritance: When properties of two or more classes are used in a single class.<\/span><\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img loading=\"lazy\" decoding=\"async\" width=\"653\" height=\"254\" src=\"https:\/\/www.h2kinfosys.com\/blog\/wp-content\/uploads\/2020\/03\/Screenshot_4-2.png\" alt=\"Hierarchical Inheritance\" class=\"wp-image-2148\" title=\"\" srcset=\"https:\/\/www.h2kinfosys.com\/blog\/wp-content\/uploads\/2020\/03\/Screenshot_4-2.png 653w, https:\/\/www.h2kinfosys.com\/blog\/wp-content\/uploads\/2020\/03\/Screenshot_4-2-300x117.png 300w\" sizes=\"(max-width: 653px) 100vw, 653px\" \/><\/figure>\n<\/div>\n\n\n<p><\/p>\n\n\n\n<p><span style=\"font-weight: 400;\">5] Hybrid Inheritance: A combination of both single and multiple inheritance. Java does not support this type of inheritance.<\/span><\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img loading=\"lazy\" decoding=\"async\" width=\"729\" height=\"360\" src=\"https:\/\/www.h2kinfosys.com\/blog\/wp-content\/uploads\/2020\/03\/Screenshot_5-2.png\" alt=\"Hybrid Inheritance\" class=\"wp-image-2149\" title=\"\" srcset=\"https:\/\/www.h2kinfosys.com\/blog\/wp-content\/uploads\/2020\/03\/Screenshot_5-2.png 729w, https:\/\/www.h2kinfosys.com\/blog\/wp-content\/uploads\/2020\/03\/Screenshot_5-2-300x148.png 300w\" sizes=\"(max-width: 729px) 100vw, 729px\" \/><\/figure>\n<\/div>\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><b>Advantages of Inheritance<\/b><\/h2>\n\n\n\n<p><span style=\"font-weight: 400;\">1] Code Reusability<\/span><\/p>\n\n\n\n<p><span style=\"font-weight: 400;\">2] Runtime Polymorphism can be achieved with the help of a method overriding concept.<\/span><\/p>\n\n\n\n<p><b>Example of Inheritance<\/b><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><em><span style=\"font-weight: 400;\">class&nbsp;Employee{<br><\/span><span style=\"font-weight: 400;\">float&nbsp;salary=60000;<br><\/span><span style=\"font-weight: 400;\">}<br><\/span><span style=\"font-weight: 400;\">class&nbsp;Tester&nbsp;extends&nbsp;Employee{<br><\/span><span style=\"font-weight: 400;\">int&nbsp;bonus=9000;<br><\/span><span style=\"font-weight: 400;\">public&nbsp;static&nbsp;void&nbsp;main(String&nbsp;args&#91;]){<br><\/span><span style=\"font-weight: 400;\">Tester&nbsp;p=new&nbsp;Tester();<br><\/span><span style=\"font-weight: 400;\">System.out.println(\"Tester&nbsp;salary&nbsp;is:\"+p.salary);<br><\/span><span style=\"font-weight: 400;\">System.out.println(\"Bonus&nbsp;of&nbsp;Tester&nbsp;is:\"+p.bonus);<br><\/span><span style=\"font-weight: 400;\">}<br><\/span><span style=\"font-weight: 400;\">}&nbsp;&nbsp;<\/span><\/em><\/code><\/pre>\n\n\n\n<p>&nbsp;<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Advanced Concepts in Inheritance<\/strong><\/h3>\n\n\n\n<p>Inheritance is not just about acquiring methods and fields from a parent class; it also involves overriding methods, accessing superclass members, and implementing <a href=\"https:\/\/www.geeksforgeeks.org\/polymorphism-in-java\/\" data-type=\"link\" data-id=\"https:\/\/www.geeksforgeeks.org\/polymorphism-in-java\/\" rel=\"nofollow noopener\" target=\"_blank\">polymorphism<\/a>. Below are more detailed explanations and examples to expand on inheritance concepts.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Accessing Superclass Members<\/strong><\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>The <code>super<\/code> keyword is used to access:\n<ol class=\"wp-block-list\">\n<li>Superclass methods or variables that are hidden by subclass methods or variables.<\/li>\n\n\n\n<li>The parent class constructor explicitly.<\/li>\n<\/ol>\n<\/li>\n<\/ul>\n\n\n\n<p><strong>Example: Using <code>super<\/code> to Access Superclass Methods and Variables<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>java <code>class Animal {\n    String name = \"Generic Animal\";\n\n    void display() {\n        System.out.println(\"I am an animal.\");\n    }\n}\n\nclass Dog extends Animal {\n    String name = \"Dog\";\n\n    void display() {\n        super.display(); \/\/ Call parent class method\n        System.out.println(\"I am a dog.\");\n    }\n\n    void printNames() {\n        System.out.println(\"Parent name: \" + super.name); \/\/ Access parent class variable\n        System.out.println(\"Child name: \" + name);        \/\/ Access child class variable\n    }\n}\n\npublic class Main {\n    public static void main(String&#91;] args) {\n        Dog dog = new Dog();\n        dog.display();\n        dog.printNames();\n    }\n}\n<\/code><\/code><\/pre>\n\n\n\n<p><strong>Output:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>css <code>I am an animal.\nI am a dog.\nParent name: Generic Animal\nChild name: Dog\n<\/code><\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Constructor Chaining in Inheritance<\/strong><\/h3>\n\n\n\n<p>When a subclass object is created, the constructor of the superclass is called automatically before the subclass constructor. This ensures proper initialization of the parent class fields.<\/p>\n\n\n\n<p><strong>Example:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>java <code>class Animal {\n    Animal() {\n        System.out.println(\"Animal constructor called.\");\n    }\n}\n\nclass Dog extends Animal {\n    Dog() {\n        super(); \/\/ Explicit call to parent constructor (optional)\n        System.out.println(\"Dog constructor called.\");\n    }\n}\n\npublic class Main {\n    public static void main(String&#91;] args) {\n        Dog dog = new Dog();\n    }\n}\n<\/code><\/code><\/pre>\n\n\n\n<p><strong>Output:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">kotlin <code>Animal constructor called.<br>Dog constructor called.<br><\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><strong> Method Overriding<\/strong><\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>A subclass can provide a specific implementation for a method already defined in the parent class.<\/li>\n\n\n\n<li>Method overriding requires:\n<ul class=\"wp-block-list\">\n<li>Same method name.<\/li>\n\n\n\n<li>Same parameter list.<\/li>\n\n\n\n<li>IS-A relationship (inheritance).<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n\n\n\n<p><strong>Example:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>java <code>class Animal {\n    void sound() {\n        System.out.println(\"Animals make sounds.\");\n    }\n}\n\nclass Dog extends Animal {\n    @Override\n    void sound() {\n        System.out.println(\"Dogs bark.\");\n    }\n}\n\npublic class Main {\n    public static void main(String&#91;] args) {\n        Animal animal = new Dog(); \/\/ Polymorphism\n        animal.sound(); \/\/ Calls overridden method in Dog class\n    }\n}\n<\/code><\/code><\/pre>\n\n\n\n<p><strong>Output:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>Dogs bark.<br><\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Final Keyword in Inheritance<\/strong><\/h3>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>Final Class:<\/strong> A <code>final<\/code> class cannot be extended.javaCopy code<code>final class Animal { void eat() { System.out.println(\"Eating...\"); } } \/\/ class Dog extends Animal {} \/\/ Compilation error<\/code><\/li>\n\n\n\n<li><strong>Final Method:<\/strong> A <code>final<\/code> method cannot be overridden.javaCopy code<code>class Animal { final void sound() { System.out.println(\"Animals make sounds.\"); } } class Dog extends Animal { \/\/ void sound() {} \/\/ Compilation error }<\/code><\/li>\n<\/ol>\n\n\n\n<h3 class=\"wp-block-heading\"><strong> Abstract Classes and Inheritance<\/strong><\/h3>\n\n\n\n<p>An <strong>abstract class<\/strong> can serve as a base class for other classes. It can have both abstract (incomplete) methods and concrete (complete) methods.<\/p>\n\n\n\n<p><strong>Example:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>java <code>abstract class Animal {\n    abstract void sound(); \/\/ Abstract method (no implementation)\n\n    void eat() {\n        System.out.println(\"This animal eats food.\");\n    }\n}\n\nclass Dog extends Animal {\n    @Override\n    void sound() {\n        System.out.println(\"Dogs bark.\");\n    }\n}\n\npublic class Main {\n    public static void main(String&#91;] args) {\n        Animal dog = new Dog(); \/\/ Abstract class reference\n        dog.eat();\n        dog.sound();\n    }\n}\n<\/code><\/code><\/pre>\n\n\n\n<p><strong>Output:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>This animal eats food.<br>Dogs bark.<br><\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Multiple Inheritance via Interfaces<\/strong><\/h3>\n\n\n\n<p>Java avoids <strong>multiple inheritance with classes<\/strong> to prevent the <strong>diamond problem<\/strong>, but it allows multiple inheritance using interfaces.<\/p>\n\n\n\n<p><strong>Example:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>java <code>interface A {\n    void methodA();\n}\n\ninterface B {\n    void methodB();\n}\n\nclass C implements A, B {\n    public void methodA() {\n        System.out.println(\"Method A implementation.\");\n    }\n\n    public void methodB() {\n        System.out.println(\"Method B implementation.\");\n    }\n}\n\npublic class Main {\n    public static void main(String&#91;] args) {\n        C obj = new C();\n        obj.methodA();\n        obj.methodB();\n    }\n}\n<\/code><\/code><\/pre>\n\n\n\n<p><strong>Output:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>css <code>Method A implementation.\nMethod B implementation.\n<\/code><\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Downcasting and Upcasting<\/strong><\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Upcasting:<\/strong> Converting a subclass object to a superclass type. Always safe.<\/li>\n\n\n\n<li><strong>Downcasting:<\/strong> Converting a superclass reference back to subclass type. Requires explicit casting and can throw <code>ClassCastException<\/code> if not done correctly.<\/li>\n<\/ul>\n\n\n\n<p><strong>Example:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>java <code>class Animal {\n    void sound() {\n        System.out.println(\"Animal makes a sound.\");\n    }\n}\n\nclass Dog extends Animal {\n    void bark() {\n        System.out.println(\"Dog barks.\");\n    }\n}\n\npublic class Main {\n    public static void main(String&#91;] args) {\n        Animal animal = new Dog(); \/\/ Upcasting\n        animal.sound();\n\n        Dog dog = (Dog) animal; \/\/ Downcasting\n        dog.bark();\n    }\n}\n<\/code><\/code><\/pre>\n\n\n\n<p><b>Super Keyword:<\/b><\/p>\n\n\n\n<p><span style=\"font-weight: 400;\">Super Keyword is used to access the properties (data members or methods) of a superclass or parent class.<\/span><\/p>\n\n\n\n<p><span style=\"font-weight: 400;\">The super keyword can be used with variable, method, and constructor.<\/span><\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><span style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">super can be used to refer to the variable of parent class where parent class and child class both have the same field.<\/span><\/span><figure><img loading=\"lazy\" decoding=\"async\" width=\"550\" height=\"486\" class=\"aligncenter wp-image-2150 size-full\" src=\"https:\/\/www.h2kinfosys.com\/blog\/wp-content\/uploads\/2020\/03\/Screenshot_6-2.png\" alt=\"Super Keyword class in java\" title=\"\" srcset=\"https:\/\/www.h2kinfosys.com\/blog\/wp-content\/uploads\/2020\/03\/Screenshot_6-2.png 550w, https:\/\/www.h2kinfosys.com\/blog\/wp-content\/uploads\/2020\/03\/Screenshot_6-2-300x265.png 300w\" sizes=\"(max-width: 550px) 100vw, 550px\" \/><\/figure><\/li>\n\n\n\n<li>super can be used to call the method of parent class when superclass and subclass have a method with the same name. It is mainly used in the case of method overriding.<br><figure><img loading=\"lazy\" decoding=\"async\" width=\"434\" height=\"528\" class=\"size-full wp-image-2151 aligncenter\" src=\"https:\/\/www.h2kinfosys.com\/blog\/wp-content\/uploads\/2020\/03\/Screenshot_7-1.png\" alt=\"\" title=\"\" srcset=\"https:\/\/www.h2kinfosys.com\/blog\/wp-content\/uploads\/2020\/03\/Screenshot_7-1.png 434w, https:\/\/www.h2kinfosys.com\/blog\/wp-content\/uploads\/2020\/03\/Screenshot_7-1-247x300.png 247w\" sizes=\"(max-width: 434px) 100vw, 434px\" \/><\/figure><\/li>\n\n\n\n<li><span style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">super() can be used to call the constructor of the parent class.<\/span><\/span><figure><img loading=\"lazy\" decoding=\"async\" width=\"448\" height=\"415\" class=\"size-full wp-image-2152 aligncenter\" src=\"https:\/\/www.h2kinfosys.com\/blog\/wp-content\/uploads\/2020\/03\/Screenshot_8-1.png\" alt=\"\" title=\"\" srcset=\"https:\/\/www.h2kinfosys.com\/blog\/wp-content\/uploads\/2020\/03\/Screenshot_8-1.png 448w, https:\/\/www.h2kinfosys.com\/blog\/wp-content\/uploads\/2020\/03\/Screenshot_8-1-300x278.png 300w\" sizes=\"(max-width: 448px) 100vw, 448px\" \/><\/figure><\/li>\n<\/ol>\n\n\n\n<p><b>Final Keyword:<\/b><\/p>\n\n\n\n<p><span style=\"font-weight: 400;\">The final keyword can be used with a variable, a method, or a class in different aspects.<\/span><\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><span style=\"font-weight: 400;\">When we want that a variable value remains constant, the final keyword is used. The value of the final variable can not be changed.<br><figure><img loading=\"lazy\" decoding=\"async\" width=\"375\" height=\"335\" class=\"aligncenter wp-image-2153 size-full\" src=\"https:\/\/www.h2kinfosys.com\/blog\/wp-content\/uploads\/2020\/03\/Screenshot_9-1.png\" alt=\"Final Keyword\" title=\"\" srcset=\"https:\/\/www.h2kinfosys.com\/blog\/wp-content\/uploads\/2020\/03\/Screenshot_9-1.png 375w, https:\/\/www.h2kinfosys.com\/blog\/wp-content\/uploads\/2020\/03\/Screenshot_9-1-300x268.png 300w\" sizes=\"(max-width: 375px) 100vw, 375px\" \/><\/figure><br><\/span><\/li>\n\n\n\n<li><span style=\"font-weight: 400;\">When we use the final keyword with the method, then it can not be overridden.<br><figure><img loading=\"lazy\" decoding=\"async\" width=\"575\" height=\"386\" class=\"size-full wp-image-2154 aligncenter\" src=\"https:\/\/www.h2kinfosys.com\/blog\/wp-content\/uploads\/2020\/03\/Screenshot_10-1.png\" alt=\"\" title=\"\" srcset=\"https:\/\/www.h2kinfosys.com\/blog\/wp-content\/uploads\/2020\/03\/Screenshot_10-1.png 575w, https:\/\/www.h2kinfosys.com\/blog\/wp-content\/uploads\/2020\/03\/Screenshot_10-1-300x201.png 300w\" sizes=\"(max-width: 575px) 100vw, 575px\" \/><\/figure><br><\/span><\/li>\n\n\n\n<li><span style=\"font-weight: 400;\">When we use the final keyword with any class, then that class cannot be extended.<\/span><\/li>\n<\/ol>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img loading=\"lazy\" decoding=\"async\" width=\"572\" height=\"330\" src=\"https:\/\/www.h2kinfosys.com\/blog\/wp-content\/uploads\/2020\/03\/Screenshot_11-1.png\" alt=\"\" class=\"wp-image-2155\" title=\"\" srcset=\"https:\/\/www.h2kinfosys.com\/blog\/wp-content\/uploads\/2020\/03\/Screenshot_11-1.png 572w, https:\/\/www.h2kinfosys.com\/blog\/wp-content\/uploads\/2020\/03\/Screenshot_11-1-300x173.png 300w\" sizes=\"(max-width: 572px) 100vw, 572px\" \/><\/figure>\n<\/div>\n\n\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Introduction Inheritance in java is a mechanism where one class acquires all the properties and behaviors of another class. The main advantage of Inheritance is reusability; we can use fields and methods of the parent class. We use Inheritance, where an &#8220;Is-A&#8221; relationship is present between two classes. The parent class in java is denoted [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":6515,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[42],"tags":[426,423,424,419,58,422,421,420,425],"class_list":["post-2144","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-java-tutorials","tag-final-keyword","tag-hierarchical","tag-hybrid-inheritance","tag-inheritance","tag-java","tag-multilevel-inheritance","tag-multiple-inheritance","tag-single-inheritance","tag-super-keyword"],"_links":{"self":[{"href":"https:\/\/www.h2kinfosys.com\/blog\/wp-json\/wp\/v2\/posts\/2144","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.h2kinfosys.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.h2kinfosys.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.h2kinfosys.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.h2kinfosys.com\/blog\/wp-json\/wp\/v2\/comments?post=2144"}],"version-history":[{"count":0,"href":"https:\/\/www.h2kinfosys.com\/blog\/wp-json\/wp\/v2\/posts\/2144\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.h2kinfosys.com\/blog\/wp-json\/wp\/v2\/media\/6515"}],"wp:attachment":[{"href":"https:\/\/www.h2kinfosys.com\/blog\/wp-json\/wp\/v2\/media?parent=2144"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.h2kinfosys.com\/blog\/wp-json\/wp\/v2\/categories?post=2144"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.h2kinfosys.com\/blog\/wp-json\/wp\/v2\/tags?post=2144"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}