{"id":5468,"date":"2023-10-23T15:14:21","date_gmt":"2023-10-23T22:14:21","guid":{"rendered":"https:\/\/ioflood.com\/blog\/?p=5468"},"modified":"2024-03-04T14:51:36","modified_gmt":"2024-03-04T21:51:36","slug":"java-extends","status":"publish","type":"post","link":"https:\/\/ioflood.com\/blog\/java-extends\/","title":{"rendered":"Java Extends Keyword: How to Make Child Classes"},"content":{"rendered":"<div class=\"wp-block-image\">\n<figure class=\"alignright size-full is-resized\"><img decoding=\"async\" src=\"https:\/\/ioflood.com\/blog\/wp-content\/uploads\/2023\/10\/Puzzle-pieces-connected-with-extends-keyword-in-Java-300x300.jpg\" alt=\"Puzzle pieces connected with extends keyword in Java\" width=\"300\" height=\"300\" title=\"\"><\/figure>\n<\/div>\n<p>Are you finding it challenging to understand inheritance in Java? You&#8217;re not alone. Many developers find themselves puzzled when it comes to mastering the &#8216;extends&#8217; keyword in Java, but we&#8217;re here to help.<\/p>\n<p>Think of Java&#8217;s inheritance as a family tree &#8211; allowing one class to inherit fields and methods from another class. This concept is a cornerstone of object-oriented programming, providing a versatile and handy tool for various tasks.<\/p>\n<p><strong>In this guide, we&#8217;ll walk you through the process of using &#8216;extends&#8217; in Java to implement inheritance<\/strong>, from its basic usage to more advanced techniques, as well as alternative approaches. We&#8217;ll cover everything from creating a subclass, multi-level inheritance, method overriding, to dealing with common issues and their solutions.<\/p>\n<p>Let&#8217;s get started and master the &#8216;extends&#8217; keyword in Java!<\/p>\n<h2>TL;DR: How Do I Use &#8216;extends&#8217; in Java?<\/h2>\n<blockquote><p>\n  In Java, &#8216;extends&#8217; is used to create a subclass that inherits attributes and methods from another class, known as the superclass, called with the syntax: <code>class SubClass extends SuperClass<\/code>. This is a fundamental part of Java&#8217;s inheritance mechanism, which is a key aspect of object-oriented programming.\n<\/p><\/blockquote>\n<p>Here&#8217;s a simple example:<\/p>\n<pre><code class=\"language-java line-numbers\">class SuperClass {\n    \/\/ some fields and methods\n}\n\nclass SubClass extends SuperClass {\n    \/\/ SubClass inherits all accessible fields and methods from SuperClass\n}\n<\/code><\/pre>\n<p>In this example, we have a <code>SuperClass<\/code> and a <code>SubClass<\/code>. The <code>SubClass<\/code> uses the &#8216;extends&#8217; keyword to inherit all accessible fields and methods from the <code>SuperClass<\/code>. This is the basic usage of &#8216;extends&#8217; in Java.<\/p>\n<blockquote><p>\n  But there&#8217;s more to the &#8216;extends&#8217; keyword than just this. Continue reading for a deeper understanding and more advanced usage scenarios.\n<\/p><\/blockquote>\n<h2>Using &#8216;Extends&#8217; to Create a Subclass in Java<\/h2>\n<p>In Java, the &#8216;extends&#8217; keyword is used to denote inheritance from a superclass. When a class extends another, it inherits all the accessible methods and fields of the superclass. This is one of the fundamental aspects of Java&#8217;s object-oriented programming.<\/p>\n<p>Let&#8217;s look at a simple example:<\/p>\n<pre><code class=\"language-java line-numbers\">\/\/ Define the superclass\n\nclass Animal {\n    void eat() {\n        System.out.println(\"Animal can eat\");\n    }\n}\n\n\/\/ Define the subclass\n\nclass Dog extends Animal {\n    void bark() {\n        System.out.println(\"Dog can bark\");\n    }\n}\n\n\/\/ Test the subclass\n\npublic class TestDog {\n    public static void main(String args[]) {\n        Dog d = new Dog();\n        d.eat();\n        d.bark();\n    }\n}\n\n# Output:\n# 'Animal can eat'\n# 'Dog can bark'\n<\/code><\/pre>\n<p>In the code above, we define a superclass <code>Animal<\/code> with a method <code>eat()<\/code>. We then create a subclass <code>Dog<\/code> using the &#8216;extends&#8217; keyword. This <code>Dog<\/code> class inherits the <code>eat()<\/code> method from <code>Animal<\/code>, and also defines its own method <code>bark()<\/code>. In the <code>TestDog<\/code> class, we create a <code>Dog<\/code> object and call both <code>eat()<\/code> and <code>bark()<\/code> methods.<\/p>\n<p>This illustrates the basic use of &#8216;extends&#8217; in Java to create a subclass. By using &#8216;extends&#8217;, we can reuse the code from the superclass, which is one of the main advantages of inheritance. However, it&#8217;s worth noting that inheritance can also lead to complexity and potential pitfalls, such as method conflicts and issues with access modifiers, which we will discuss in the following sections.<\/p>\n<h2>Advanced Inheritance: Multi-level and Method Overriding<\/h2>\n<p>As you become more comfortable with the &#8216;extends&#8217; keyword and inheritance in Java, you can start to explore more advanced uses, such as multi-level inheritance and method overriding.<\/p>\n<h3>Multi-level Inheritance<\/h3>\n<p>In Java, a class can extend another class, which in turn extends another class, forming a chain of inheritance. This is known as multi-level inheritance.<\/p>\n<p>Here&#8217;s an example:<\/p>\n<pre><code class=\"language-java line-numbers\">\/\/ Define the superclass\n\nclass Animal {\n    void eat() {\n        System.out.println(\"Animal can eat\");\n    }\n}\n\n\/\/ Define the intermediate class\n\nclass Dog extends Animal {\n    void bark() {\n        System.out.println(\"Dog can bark\");\n    }\n}\n\n\/\/ Define the subclass\n\nclass Puppy extends Dog {\n    void weep() {\n        System.out.println(\"Puppy can weep\");\n    }\n}\n\n\/\/ Test the subclass\n\npublic class TestPuppy {\n    public static void main(String args[]) {\n        Puppy p = new Puppy();\n        p.eat();\n        p.bark();\n        p.weep();\n    }\n}\n\n# Output:\n# 'Animal can eat'\n# 'Dog can bark'\n# 'Puppy can weep'\n<\/code><\/pre>\n<p>In this example, <code>Puppy<\/code> extends <code>Dog<\/code>, which in turn extends <code>Animal<\/code>, forming a chain of inheritance. The <code>Puppy<\/code> class can access methods from both <code>Dog<\/code> and <code>Animal<\/code>.<\/p>\n<h3>Method Overriding<\/h3>\n<p>Another advanced use of &#8216;extends&#8217; is method overriding. In Java, when a subclass has a method with the same name as a method in its superclass, the subclass&#8217;s method overrides the one in the superclass.<\/p>\n<p>Let&#8217;s see an example:<\/p>\n<pre><code class=\"language-java line-numbers\">\/\/ Define the superclass\n\nclass Animal {\n    void eat() {\n        System.out.println(\"Animal can eat\");\n    }\n}\n\n\/\/ Define the subclass\n\nclass Dog extends Animal {\n    \/\/ Override the eat() method\n    void eat() {\n        System.out.println(\"Dog can eat dog food\");\n    }\n}\n\n\/\/ Test the subclass\n\npublic class TestDog {\n    public static void main(String args[]) {\n        Dog d = new Dog();\n        d.eat();\n    }\n}\n\n# Output:\n# 'Dog can eat dog food'\n<\/code><\/pre>\n<p>In the code above, <code>Dog<\/code> overrides the <code>eat()<\/code> method of <code>Animal<\/code>. When we call <code>eat()<\/code> on a <code>Dog<\/code> object, the overridden method in <code>Dog<\/code> is executed instead of the one in <code>Animal<\/code>.<\/p>\n<p>These are just a few examples of the advanced uses of &#8216;extends&#8217; in Java. As you continue to explore, you&#8217;ll find that inheritance, along with other features of object-oriented programming, provide powerful tools for structuring and organizing your code.<\/p>\n<h2>Exploring Alternatives: Interfaces and Abstract Classes<\/h2>\n<p>While the &#8216;extends&#8217; keyword and inheritance are powerful tools in Java, they are not the only way to achieve code reuse and polymorphism. Two other key concepts in Java&#8217;s object-oriented toolbox are interfaces and abstract classes.<\/p>\n<h3>Interfaces in Java<\/h3>\n<p>An interface is a completely abstract class that contains only abstract methods. It can be implemented by any class, using the &#8216;implements&#8217; keyword. Unlike &#8216;extends&#8217;, a class can implement multiple interfaces.<\/p>\n<p>Here&#8217;s a simple example:<\/p>\n<pre><code class=\"language-java line-numbers\">\/\/ Define the interface\n\ninterface Eater {\n    void eat();\n}\n\n\/\/ Implement the interface\n\nclass Dog implements Eater {\n    public void eat() {\n        System.out.println(\"Dog is eating\");\n    }\n}\n\n\/\/ Test the implementation\n\npublic class TestDog {\n    public static void main(String args[]) {\n        Dog d = new Dog();\n        d.eat();\n    }\n}\n\n# Output:\n# 'Dog is eating'\n<\/code><\/pre>\n<p>In this code, we define an <code>Eater<\/code> interface with a single method <code>eat()<\/code>. The <code>Dog<\/code> class then implements this interface, providing its own implementation of <code>eat()<\/code>. This demonstrates one of the advantages of interfaces &#8211; they provide a way to ensure that a class adheres to a certain contract, without imposing any inheritance hierarchy.<\/p>\n<h3>Abstract Classes in Java<\/h3>\n<p>An abstract class in Java is a class that cannot be instantiated and is meant to be subclassed. It can contain both abstract and non-abstract methods.<\/p>\n<p>Here&#8217;s an example:<\/p>\n<pre><code class=\"language-java line-numbers\">\/\/ Define the abstract class\n\nabstract class Animal {\n    abstract void eat();\n    void sleep() {\n        System.out.println(\"Animal is sleeping\");\n    }\n}\n\n\/\/ Extend the abstract class\n\nclass Dog extends Animal {\n    void eat() {\n        System.out.println(\"Dog is eating\");\n    }\n}\n\n\/\/ Test the subclass\n\npublic class TestDog {\n    public static void main(String args[]) {\n        Dog d = new Dog();\n        d.eat();\n        d.sleep();\n    }\n}\n\n# Output:\n# 'Dog is eating'\n# 'Animal is sleeping'\n<\/code><\/pre>\n<p>In this example, <code>Animal<\/code> is an abstract class with an abstract method <code>eat()<\/code> and a non-abstract method <code>sleep()<\/code>. <code>Dog<\/code> extends <code>Animal<\/code> and provides its own implementation of <code>eat()<\/code>. This demonstrates the power of abstract classes &#8211; they can provide some default behavior (like <code>sleep()<\/code>) while forcing subclasses to provide others (like <code>eat()<\/code>).<\/p>\n<h3>Choosing the Right Tool<\/h3>\n<p>When designing your Java classes, it&#8217;s important to choose the right tool for the job. If you need to create a hierarchy of related classes that share common behavior, &#8216;extends&#8217; and inheritance might be the way to go. If you need to ensure that a class adheres to a certain contract, consider using an interface. If you want to provide some default behavior but also force subclasses to provide specific behavior, an abstract class could be the answer.<\/p>\n<p>Remember, each of these tools has its own strengths and weaknesses, and they can often be used together in powerful ways. Understanding the &#8216;extends&#8217; keyword is just the beginning of your journey into Java&#8217;s object-oriented programming features.<\/p>\n<h2>Navigating Inheritance Pitfalls: Method Conflicts and Access Modifiers<\/h2>\n<p>As with any powerful tool, Java&#8217;s &#8216;extends&#8217; keyword and inheritance mechanism come with their own set of challenges. Two common issues that developers often encounter are method conflicts and access modifier restrictions. Let&#8217;s explore these in detail.<\/p>\n<h3>Resolving Method Conflicts<\/h3>\n<p>One common issue that arises with inheritance is method conflicts, especially when dealing with multi-level inheritance or when a subclass overrides a superclass&#8217;s method. Let&#8217;s consider an example.<\/p>\n<pre><code class=\"language-java line-numbers\">class Animal {\n    void eat() {\n        System.out.println(\"Animal is eating\");\n    }\n}\n\nclass Dog extends Animal {\n    void eat() {\n        System.out.println(\"Dog is eating dog food\");\n    }\n}\n\nclass Puppy extends Dog {\n    void eat() {\n        System.out.println(\"Puppy is eating puppy food\");\n    }\n}\n\npublic class TestPuppy {\n    public static void main(String args[]) {\n        Puppy p = new Puppy();\n        p.eat();\n    }\n}\n\n# Output:\n# 'Puppy is eating puppy food'\n<\/code><\/pre>\n<p>In the above code, the <code>Puppy<\/code> class overrides the <code>eat()<\/code> method of the <code>Dog<\/code> class, which in turn overrides the <code>eat()<\/code> method of the <code>Animal<\/code> class. When we call <code>eat()<\/code> on a <code>Puppy<\/code> object, the <code>Puppy<\/code>&#8216;s <code>eat()<\/code> method is executed, not the <code>Dog<\/code>&#8216;s or <code>Animal<\/code>&#8216;s. This is a simple example of how method conflicts can arise and how Java resolves them.<\/p>\n<h3>Understanding Access Modifiers<\/h3>\n<p>Another common issue with inheritance in Java is dealing with access modifiers. In Java, there are four access modifiers: private, default (no modifier), protected, and public. These determine the visibility of fields and methods in the superclass and subclass.<\/p>\n<p>Here&#8217;s a quick overview:<\/p>\n<table>\n<thead>\n<tr>\n<th>Modifier<\/th>\n<th>Class<\/th>\n<th>Package<\/th>\n<th>Subclass<\/th>\n<th>World<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>public<\/td>\n<td>Y<\/td>\n<td>Y<\/td>\n<td>Y<\/td>\n<td>Y<\/td>\n<\/tr>\n<tr>\n<td>protected<\/td>\n<td>Y<\/td>\n<td>Y<\/td>\n<td>Y<\/td>\n<td>N<\/td>\n<\/tr>\n<tr>\n<td>no modifier (default)<\/td>\n<td>Y<\/td>\n<td>Y<\/td>\n<td>N<\/td>\n<td>N<\/td>\n<\/tr>\n<tr>\n<td>private<\/td>\n<td>Y<\/td>\n<td>N<\/td>\n<td>N<\/td>\n<td>N<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>In the context of inheritance, the &#8216;extends&#8217; keyword can only inherit public and protected members of a superclass. Private members are not inherited because they are only visible within the class they are defined.<\/p>\n<p>By understanding these common issues and how to navigate them, you can use the &#8216;extends&#8217; keyword and Java&#8217;s inheritance mechanism more effectively and avoid potential pitfalls.<\/p>\n<h2>Unpacking Inheritance: A Pillar of Object-Oriented Programming<\/h2>\n<p>To fully understand the &#8216;extends&#8217; keyword and its role in Java, it&#8217;s crucial to grasp the concept of inheritance and its place in object-oriented programming (OOP).<\/p>\n<h3>Inheritance in Java<\/h3>\n<p>Inheritance is one of the four primary principles of OOP, alongside encapsulation, abstraction, and polymorphism. It&#8217;s a mechanism that allows one class to acquire the properties (methods and fields) of another. With the use of the &#8216;extends&#8217; keyword, a class (subclass) can inherit features from another class (superclass).<\/p>\n<pre><code class=\"language-java line-numbers\">class SuperClass {\n    \/\/ fields and methods\n}\n\nclass SubClass extends SuperClass {\n    \/\/ SubClass inherits all accessible fields and methods from SuperClass\n}\n<\/code><\/pre>\n<p>In this example, <code>SubClass<\/code> inherits all accessible fields and methods from <code>SuperClass<\/code> using the &#8216;extends&#8217; keyword.<\/p>\n<h3>Object-Oriented Programming (OOP) in Java<\/h3>\n<p>OOP is a programming paradigm centered around objects. These objects are instances of classes, which can contain data in the form of fields (also known as attributes) and code in the form of procedures (also known as methods).<\/p>\n<p>Java, as an object-oriented language, uses classes and objects as its fundamental building blocks. These classes interact with each other to design applications and programs. Inheritance, enabled by the &#8216;extends&#8217; keyword, is a key part of this interaction, allowing classes to reuse, extend, and modify the behavior defined in other classes.<\/p>\n<p>By understanding the concept of inheritance and its role in OOP, you can better understand and utilize the &#8216;extends&#8217; keyword in Java.<\/p>\n<h2>Inheritance in Real-World Applications<\/h2>\n<p>Inheritance, facilitated by the &#8216;extends&#8217; keyword in Java, isn&#8217;t just a theoretical concept. It&#8217;s a practical tool that developers use every day in real-world applications. Whether you&#8217;re building a simple web app or a complex enterprise system, understanding inheritance can help you design your classes and objects more effectively.<\/p>\n<h3>Exploring Related Concepts: Polymorphism and Encapsulation<\/h3>\n<p>While inheritance is a powerful tool, it&#8217;s just one part of the object-oriented programming toolbox. Two other key concepts you might want to explore are polymorphism and encapsulation.<\/p>\n<p>Polymorphism allows objects of different classes to be treated as objects of a common superclass. This can make your code more flexible and extensible. Encapsulation, on the other hand, is about hiding the internal details of how an object works and exposing only what&#8217;s necessary, which can make your code more maintainable and less prone to errors.<\/p>\n<h3>Real-World Application of Inheritance<\/h3>\n<p>In real-world applications, inheritance is often used to create a set of related classes that share common behavior but also have their own specific behaviors. For example, in a graphics program, you might have a <code>Shape<\/code> superclass with subclasses like <code>Circle<\/code>, <code>Rectangle<\/code>, and <code>Triangle<\/code>. Each of these subclasses would inherit common properties like <code>color<\/code> and <code>position<\/code> from <code>Shape<\/code>, but also have their own specific properties like <code>radius<\/code> for <code>Circle<\/code> and <code>width<\/code> and <code>height<\/code> for <code>Rectangle<\/code>.<\/p>\n<h3>Further Resources for Mastering Java Inheritance<\/h3>\n<p>Ready to dive deeper into Java inheritance and related concepts? Here are a few resources to help you on your journey:<\/p>\n<ul>\n<li>IOFlood&#8217;s <a class=\"wp-editor-md-post-content-link\" href=\"https:\/\/ioflood.com\/blog\/keywords-of-java\/\">Java Keywords Article<\/a> &#8211; Learn about access modifiers like &#8220;private,&#8221; &#8220;protected,&#8221; and &#8220;default&#8221; in Java.<\/p>\n<\/li>\n<li>\n<p><a class=\"wp-editor-md-post-content-link\" href=\"https:\/\/ioflood.com\/blog\/super-java\/\"><code>super<\/code> Keyword in Java<\/a> &#8211; Learn about the &#8216;super&#8217; keyword in Java for accessing members of the superclass.<\/p>\n<\/li>\n<li>\n<p><a class=\"wp-editor-md-post-content-link\" href=\"https:\/\/ioflood.com\/blog\/java-record\/\">Java Records Overview<\/a> &#8211; Discover Java record, a feature introduced in Java 14 for concise and immutable data modeling.<\/p>\n<\/li>\n<li>\n<p><a class=\"wp-editor-md-post-content-link\" href=\"https:\/\/docs.oracle.com\/javase\/tutorial\/java\/IandI\/subclasses.html\" target=\"_blank\" rel=\"noopener\">Oracle&#8217;s Java Tutorials: Inheritance<\/a> &#8211; The official Java tutorials from Oracle.<\/p>\n<\/li>\n<li>\n<p>GeeksforGeeks&#8217; <a class=\"wp-editor-md-post-content-link\" href=\"https:\/\/www.geeksforgeeks.org\/inheritance-in-java\/\" target=\"_blank\" rel=\"noopener\">Java Inheritance<\/a> is a comprehensive guide on Java inheritance.<\/p>\n<\/li>\n<li>\n<p>Baeldung&#8217;s <a class=\"wp-editor-md-post-content-link\" href=\"https:\/\/www.baeldung.com\/java-inheritance\" target=\"_blank\" rel=\"noopener\">A Guide to Java Inheritance<\/a> covers Java inheritance and related concepts like abstraction and polymorphism.<\/p>\n<\/li>\n<\/ul>\n<p>Remember, mastering a concept like inheritance takes time and practice. Don&#8217;t rush it. Experiment with code, make mistakes, learn from them, and keep refining your understanding. Happy coding!<\/p>\n<h2>Wrapping Up: Mastering &#8216;Extends&#8217; in Java for Inheritance<\/h2>\n<p>In this comprehensive guide, we&#8217;ve explored the &#8216;extends&#8217; keyword in Java, a fundamental aspect of inheritance in object-oriented programming. We&#8217;ve discussed how to use &#8216;extends&#8217; for creating subclasses, handling multi-level inheritance, and method overriding, along with the common issues associated with these processes.<\/p>\n<p>We began with the basics, guiding you on how to use &#8216;extends&#8217; to create a subclass in Java, including a code example with an explanation of how inheritance works. We then ventured into more complex uses of &#8216;extends&#8217;, such as multi-level inheritance and method overriding, providing intermediate-level code examples and analysis.<\/p>\n<p>To help you navigate the common issues with inheritance, we discussed method conflicts and access modifiers, providing solutions and workarounds for each issue. We also introduced you to alternative approaches to handle inheritance, like interfaces and abstract classes, giving you a broader perspective on the topic.<\/p>\n<p>Here&#8217;s a quick comparison of the methods we&#8217;ve discussed:<\/p>\n<table>\n<thead>\n<tr>\n<th>Method<\/th>\n<th>Pros<\/th>\n<th>Cons<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>&#8216;Extends&#8217; Keyword<\/td>\n<td>Enables code reuse and polymorphism<\/td>\n<td>Can lead to complexity and potential pitfalls<\/td>\n<\/tr>\n<tr>\n<td>Interfaces<\/td>\n<td>Ensures a class adheres to a certain contract<\/td>\n<td>No default behavior<\/td>\n<\/tr>\n<tr>\n<td>Abstract Classes<\/td>\n<td>Can provide default behavior and force subclasses to provide specific behavior<\/td>\n<td>Requires careful design<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>Whether you&#8217;re a beginner just starting out with Java or an intermediate developer looking to deepen your understanding of inheritance, we hope this guide has provided you with a comprehensive understanding of the &#8216;extends&#8217; keyword and its usage in Java.<\/p>\n<p>The &#8216;extends&#8217; keyword is a powerful tool in your Java toolbox, enabling you to leverage the power of inheritance in your programs. With this guide, you&#8217;re now well equipped to use &#8216;extends&#8217; effectively in your Java programming journey. Happy coding!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Are you finding it challenging to understand inheritance in Java? You&#8217;re not alone. Many developers find themselves puzzled when it comes to mastering the &#8216;extends&#8217; keyword in Java, but we&#8217;re here to help. Think of Java&#8217;s inheritance as a family tree &#8211; allowing one class to inherit fields and methods from another class. This concept [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":10293,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[154,121],"tags":[],"class_list":["post-5468","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-java","category-programming-coding","cat-154-id","cat-121-id","has_thumb"],"_links":{"self":[{"href":"https:\/\/ioflood.com\/blog\/wp-json\/wp\/v2\/posts\/5468","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ioflood.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ioflood.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ioflood.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ioflood.com\/blog\/wp-json\/wp\/v2\/comments?post=5468"}],"version-history":[{"count":10,"href":"https:\/\/ioflood.com\/blog\/wp-json\/wp\/v2\/posts\/5468\/revisions"}],"predecessor-version":[{"id":17948,"href":"https:\/\/ioflood.com\/blog\/wp-json\/wp\/v2\/posts\/5468\/revisions\/17948"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ioflood.com\/blog\/wp-json\/wp\/v2\/media\/10293"}],"wp:attachment":[{"href":"https:\/\/ioflood.com\/blog\/wp-json\/wp\/v2\/media?parent=5468"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ioflood.com\/blog\/wp-json\/wp\/v2\/categories?post=5468"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ioflood.com\/blog\/wp-json\/wp\/v2\/tags?post=5468"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}