

{"id":120668,"date":"2023-12-02T18:00:17","date_gmt":"2023-12-02T12:30:17","guid":{"rendered":"https:\/\/data-flair.training\/blogs\/?p=120668"},"modified":"2023-12-02T18:33:03","modified_gmt":"2023-12-02T13:03:03","slug":"swift-inheritance","status":"publish","type":"post","link":"https:\/\/data-flair.training\/blogs\/swift-inheritance\/","title":{"rendered":"What is Swift Inheritance"},"content":{"rendered":"<p>Inheritance is an important concept associated with Object-Oriented Programming. We can create child classes which inherit entities from a parent class. In this article, we\u2019ll learn about inheritance in Swift and what base classes and subclasses are. We will also go through concepts related to inheritance, such as overriding and superclass.<\/p>\n<h2>Why Inheritance?<\/h2>\n<p>Inheritance enables us to reuse our code. It allows the child classes to inherit the properties and methods of its parent class. For example, we can have a parent class called Animals, and it has a property name and a method sound. It can have child classes called Dog and Cat. These child classes can inherit the sound method from its parent class.<\/p>\n<h3>Basics of Inheritance<\/h3>\n<p>We can classify the classes in inheritance into subclasses or superclasses. The subclass is the child class that inherits behaviour from its parent class. This parent class from which the subclass inherits is called a Super Class.<\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/11\/inheritance.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-124803 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/11\/inheritance.webp\" alt=\"inheritance\" width=\"200\" height=\"200\" \/><\/a><\/p>\n<h4>is-a relationship<\/h4>\n<p>We can use inheritance only when there is a is-a relationship between the classes. <strong>For example,<\/strong><\/p>\n<p>Car is a Vehicle<br \/>\nMango is a Fruit.<br \/>\nHexagon is a Shape<\/p>\n<h3>Defining a Base class in Swift<\/h3>\n<p>A base class is a class that doesn\u2019t inherit anything from another class. We define a base class like we define a class.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">class ClassName{\r\n    \/\/code \r\n}<\/pre>\n<p><strong>For example, here we have the base class as Animal. Other classes will inherit entities from this base class Animal.<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">class Animal{\r\n    var name: String\r\n    \r\n    init(name: String){\r\n        self.name = name\r\n    }\r\n    \r\n    func sound(){\r\n        print(\"\\(name) makes sound\")\r\n    }\r\n}<\/pre>\n<h3>Subclassing in Swift<\/h3>\n<p>Subclassing is when we base a new class on an existing class. The subclass inherits properties, methods and functions from the superclass. We can also add new properties, methods or functions to this subclass.<\/p>\n<p><strong>Syntax to define a subclass.<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">class SubClassName: SuperClassName {\r\n    \/\/code\r\n}<\/pre>\n<p><strong>For example,<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">class Animal{\r\n    var name: String\r\n    \r\n    init(name: String){\r\n        self.name = name\r\n    }\r\n    \r\n    func sound(){\r\n        print(\"\\(name) makes sound\")\r\n    }\r\n}\r\n class Dog: Animal{\r\n     var breed: String\r\n     \r\n     init(name: String, breed: String){\r\n         self.breed = breed\r\n         super.init(name: name)\r\n     }\r\n\r\n     override func sound(){\r\n         print(\"\\(name) barks.\")\r\n     }\r\n\r\n     func play(){\r\n         print(\"\\(name) plays.\")\r\n     }\r\n }<\/pre>\n<p>Here, we defined a subclass Dog of the class Animal. The subclass has its own property and methods. It also inherits the properties and methods from its superclass.<\/p>\n<h3>Overriding in Swift<\/h3>\n<p>An object of a subclass can access methods defined in its class as well as its superclass. But it can also define the same method in it. To do so, we override the method from the parent class. The override keyword informs the compiler that we are overriding a property or method.<\/p>\n<p><strong>The syntax to override a method is as follows.<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">override func functionName(){\r\n    \/\/code\r\n}<\/pre>\n<h4>Method Overriding<\/h4>\n<p>When we override a method of the superclass in the subclass, we call it method overriding. <strong>For example,<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">class Animal{\r\n    var name: String\r\n    \r\n    init(name: String){\r\n        self.name = name\r\n    }\r\n    \r\n    func sound(){\r\n        print(\"\\(name) makes sound\")\r\n    }\r\n}\r\n class Dog: Animal{\r\n     var color: String\r\n     \r\n     init(name: String, color: String){\r\n         self.color = color\r\n         super.init(name: name)\r\n     }\r\n     \r\n     override func sound(){\r\n         print(\"\\(name) barks.\")\r\n     }\r\n     \r\n }\r\n\r\nvar dog = Dog(name: \"Louis\", color: \"Brown\")\r\n\r\ndog.sound()<\/pre>\n<p><strong>Output:<\/strong><\/p>\n<p>Louis barks.<\/p>\n<p>Here, the method from the superclass is overridden.<\/p>\n<h4>Property Overriding<\/h4>\n<p>We can override a superclass property in a subclass. In this way, we can either customize or extend the property&#8217;s usage. We can use property overriding with inherited stored and computed properties by using a custom getter and setter.<\/p>\n<p>We cannot override inherited constant stored and inherited read-only properties.<\/p>\n<p><strong>For example,<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">class Animal{\r\n    var name: String\r\n    \r\n    init(name: String){\r\n        self.name = name\r\n    }\r\n    \r\n    var description: String{\r\n        return \"This is Animal \\(name).\"\r\n    }\r\n}\r\n class Dog: Animal{\r\n     var color: String\r\n     \r\n     init(name: String, color: String){\r\n         self.color = color\r\n         super.init(name: name)\r\n     }\r\n     \r\n     override var description: String{\r\n        return \"Overridden property. This is Dog \\(name).\"\r\n    }\r\n     \r\n }\r\n\r\nvar dog = Dog(name: \"Louis\", color: \"Brown\")\r\n\r\nprint(dog.description)<\/pre>\n<p><strong>Output:<\/strong><\/p>\n<p>Overridden property. This is Dog Louis.<\/p>\n<p>Here, the property description is an overriding property.<\/p>\n<p><strong>Overriding Property Observers<\/strong><\/p>\n<p>We can also use property overriding to add property observed to inherited properties. It will notify us when the inherited value changes. Note that we cannot add these observers to inherited read-only computed property or inherited constant stored property as we cannot set their values.<\/p>\n<h3>Final Keyword in Swift<\/h3>\n<p>If we don\u2019t want subclasses to override class properties or methods, we can use the final keyword. We can use the final keyword to prevent subclassing if we don\u2019t want a class to have a subclass. If we try to override even when the final keyword is used, then the Swift compiler throws an error. If we try to create a subclass from a final class, then also the Swift compiler generates errors.<\/p>\n<p>In the example, we have a final method sound() in the Animal class. If we try to override the final method, the Swift compiler gives an error.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">class Animal{\r\n    final var name: String\r\n    \r\n    init(name: String){\r\n        self.name = name\r\n    }\r\n    \r\n    final func sound(){\r\n        print(\"\\(name) makes sound\")\r\n    }\r\n}\r\n class Dog: Animal{\r\n     var color: String\r\n     \r\n     init(name: String, color: String){\r\n         self.color = color\r\n         super.init(name: name)\r\n     }\r\n     \r\n     override func sound(){ \r\n        super.sound()\r\n         print(\"\\(name) barks.\")\r\n     }\r\n }<\/pre>\n<p><strong>Output:<\/strong><\/p>\n<p><strong>swift:20:20: error:<\/strong> instance method overrides a &#8216;final&#8217; instance method<br \/>\noverride func sound(){<br \/>\n^<br \/>\n<strong>swift:8:16: note:<\/strong> overridden declaration is here<br \/>\nfinal func sound(){<br \/>\n^<\/p>\n<p><strong>In the given example, we made the Animal class as final. When we try to subclass this method, we encounter errors.<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">final class Animal{\r\n    final var name: String\r\n    \r\n    init(name: String){\r\n        self.name = name\r\n    }\r\n}\r\n class Dog: Animal{\r\n     var color: String\r\n     \r\n     init(name: String, color: String){\r\n         self.color = color\r\n         super.init(name: name)\r\n     }\r\n }<\/pre>\n<p><strong>Output:<\/strong><\/p>\n<p><strong>swift:8:8: error:<\/strong> inheritance from a final class &#8216;Animal&#8217;<br \/>\n<strong>class Dog:<\/strong> Animal{<br \/>\n^<\/p>\n<h3>Super keyword in Swift<\/h3>\n<p>We can override a method in the subclass from the superclass. But if we want to access a method from the superclass in the subclass, then we use the super keyword. <strong>For example,<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">class Animal{\r\n    var name: String\r\n    \r\n    init(name: String){\r\n        self.name = name\r\n    }\r\n    \r\n    func sound(){\r\n        print(\"\\(name) makes sound\")\r\n    }\r\n}\r\n class Dog: Animal{\r\n     var color: String\r\n     \r\n     init(name: String, color: String){\r\n         self.color = color\r\n         \/\/ calling the method from superclass using the super keyword\r\n         super.init(name: name)\r\n     }\r\n     \r\n     override func sound(){ \r\n         \/\/ calling the method from superclass using the super keyword\r\n         super.sound()\r\n         print(\"\\(name) barks.\")\r\n     }\r\n }\r\n\r\nvar dog = Dog(name: \"Louis\", color: \"Brown\")\r\n\r\ndog.sound()<\/pre>\n<p><strong>Output:<\/strong><\/p>\n<p>Louis makes sound<br \/>\nLouis barks.<\/p>\n<p><strong>The following table depicts how we can access the entities from the superclass in a subclass.<\/strong><\/p>\n<table>\n<tbody>\n<tr>\n<td><b>Overriding Entity<\/b><\/td>\n<td><b>Syntax<\/b><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">Methods<\/span><\/td>\n<td><span style=\"font-weight: 400\">super.exampleMethod()<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">Properties<\/span><\/td>\n<td><span style=\"font-weight: 400\">super.exampleProperty()<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">Subscripts<\/span><\/td>\n<td><span style=\"font-weight: 400\">super[exampleIndex]<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3>Conclusion<\/h3>\n<p>Swift is an object-oriented programming language. Hence, it allows inheritance. Inheritances enable us to reuse our code. It allows the subclasses to inherit entities from its superclass.<\/p>\n<p>In this article, we\u2019ve seen the basics of swift inheritance and how we define a base class and subclass. We have also understood concepts of overriding and the usage of keywords like final, super, and override in swift inheritance. We have also gone through relevant concepts to each of these concepts.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Inheritance is an important concept associated with Object-Oriented Programming. We can create child classes which inherit entities from a parent class. In this article, we\u2019ll learn about inheritance in Swift and what base classes&#46;&#46;&#46;<\/p>\n","protected":false},"author":581,"featured_media":120670,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[27789],"tags":[28807,28806,21771,28805,28287],"class_list":["post-120668","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-swift-tutorials","tag-basics-of-inheritance","tag-inheritance-in-swift","tag-swift","tag-swift-inheritance","tag-swift-tutorials"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.8 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>What is Swift Inheritance - DataFlair<\/title>\n<meta name=\"description\" content=\"Swift is an object-oriented programming language. In this article, we\u2019ve seen the basics of swift inheritance and how we define a base class and subclass.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/data-flair.training\/blogs\/swift-inheritance\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"What is Swift Inheritance - DataFlair\" \/>\n<meta property=\"og:description\" content=\"Swift is an object-oriented programming language. In this article, we\u2019ve seen the basics of swift inheritance and how we define a base class and subclass.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/data-flair.training\/blogs\/swift-inheritance\/\" \/>\n<meta property=\"og:site_name\" content=\"DataFlair\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/DataFlairWS\/\" \/>\n<meta property=\"article:published_time\" content=\"2023-12-02T12:30:17+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-12-02T13:03:03+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/09\/swift-inheritance.webp\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"628\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/webp\" \/>\n<meta name=\"author\" content=\"DataFlair Team\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@DataFlairWS\" \/>\n<meta name=\"twitter:site\" content=\"@DataFlairWS\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"DataFlair Team\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"What is Swift Inheritance - DataFlair","description":"Swift is an object-oriented programming language. In this article, we\u2019ve seen the basics of swift inheritance and how we define a base class and subclass.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/data-flair.training\/blogs\/swift-inheritance\/","og_locale":"en_US","og_type":"article","og_title":"What is Swift Inheritance - DataFlair","og_description":"Swift is an object-oriented programming language. In this article, we\u2019ve seen the basics of swift inheritance and how we define a base class and subclass.","og_url":"https:\/\/data-flair.training\/blogs\/swift-inheritance\/","og_site_name":"DataFlair","article_publisher":"https:\/\/www.facebook.com\/DataFlairWS\/","article_published_time":"2023-12-02T12:30:17+00:00","article_modified_time":"2023-12-02T13:03:03+00:00","og_image":[{"width":1200,"height":628,"url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/09\/swift-inheritance.webp","type":"image\/webp"}],"author":"DataFlair Team","twitter_card":"summary_large_image","twitter_creator":"@DataFlairWS","twitter_site":"@DataFlairWS","twitter_misc":{"Written by":"DataFlair Team","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/data-flair.training\/blogs\/swift-inheritance\/#article","isPartOf":{"@id":"https:\/\/data-flair.training\/blogs\/swift-inheritance\/"},"author":{"name":"DataFlair Team","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/person\/c187795dc82ab948373cca526df7c445"},"headline":"What is Swift Inheritance","datePublished":"2023-12-02T12:30:17+00:00","dateModified":"2023-12-02T13:03:03+00:00","mainEntityOfPage":{"@id":"https:\/\/data-flair.training\/blogs\/swift-inheritance\/"},"wordCount":837,"commentCount":0,"publisher":{"@id":"https:\/\/data-flair.training\/blogs\/#organization"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/swift-inheritance\/#primaryimage"},"thumbnailUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/09\/swift-inheritance.webp","keywords":["basics of inheritance","inheritance in swift","Swift","swift inheritance","swift tutorials"],"articleSection":["Swift Tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/data-flair.training\/blogs\/swift-inheritance\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/data-flair.training\/blogs\/swift-inheritance\/","url":"https:\/\/data-flair.training\/blogs\/swift-inheritance\/","name":"What is Swift Inheritance - DataFlair","isPartOf":{"@id":"https:\/\/data-flair.training\/blogs\/#website"},"primaryImageOfPage":{"@id":"https:\/\/data-flair.training\/blogs\/swift-inheritance\/#primaryimage"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/swift-inheritance\/#primaryimage"},"thumbnailUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/09\/swift-inheritance.webp","datePublished":"2023-12-02T12:30:17+00:00","dateModified":"2023-12-02T13:03:03+00:00","description":"Swift is an object-oriented programming language. In this article, we\u2019ve seen the basics of swift inheritance and how we define a base class and subclass.","breadcrumb":{"@id":"https:\/\/data-flair.training\/blogs\/swift-inheritance\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/data-flair.training\/blogs\/swift-inheritance\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/data-flair.training\/blogs\/swift-inheritance\/#primaryimage","url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/09\/swift-inheritance.webp","contentUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/09\/swift-inheritance.webp","width":1200,"height":628,"caption":"swift inheritance"},{"@type":"BreadcrumbList","@id":"https:\/\/data-flair.training\/blogs\/swift-inheritance\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Blog Home","item":"https:\/\/data-flair.training\/blogs\/"},{"@type":"ListItem","position":2,"name":"Swift Tutorials","item":"https:\/\/data-flair.training\/blogs\/category\/swift-tutorials\/"},{"@type":"ListItem","position":3,"name":"What is Swift Inheritance"}]},{"@type":"WebSite","@id":"https:\/\/data-flair.training\/blogs\/#website","url":"https:\/\/data-flair.training\/blogs\/","name":"DataFlair","description":"Learn Today. Lead Tomorrow.","publisher":{"@id":"https:\/\/data-flair.training\/blogs\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/data-flair.training\/blogs\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/data-flair.training\/blogs\/#organization","name":"DataFlair","url":"https:\/\/data-flair.training\/blogs\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/logo\/image\/","url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/07\/Data-Flair.png","contentUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/07\/Data-Flair.png","width":106,"height":48,"caption":"DataFlair"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/DataFlairWS\/","https:\/\/x.com\/DataFlairWS","https:\/\/www.linkedin.com\/company\/dataflair-web-services-pvt-ltd\/","https:\/\/www.youtube.com\/user\/DataFlairWS"]},{"@type":"Person","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/person\/c187795dc82ab948373cca526df7c445","name":"DataFlair Team","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/2302ebc438084d2f1f993edc1996a0aae01332e81f3227cba8df0c48ec010ca4?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/2302ebc438084d2f1f993edc1996a0aae01332e81f3227cba8df0c48ec010ca4?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/2302ebc438084d2f1f993edc1996a0aae01332e81f3227cba8df0c48ec010ca4?s=96&d=mm&r=g","caption":"DataFlair Team"},"description":"DataFlair Team provides high-impact content on programming, Java, Python, C++, DSA, AI, ML, data Science, Android, Flutter, MERN, Web Development, and technology. We make complex concepts easy to grasp, helping learners of all levels succeed in their tech careers.","url":"https:\/\/data-flair.training\/blogs\/author\/dfteam6\/"}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/120668","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/users\/581"}],"replies":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/comments?post=120668"}],"version-history":[{"count":6,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/120668\/revisions"}],"predecessor-version":[{"id":131677,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/120668\/revisions\/131677"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/media\/120670"}],"wp:attachment":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/media?parent=120668"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/categories?post=120668"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/tags?post=120668"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}