

{"id":18314,"date":"2018-06-12T04:08:01","date_gmt":"2018-06-12T04:08:01","guid":{"rendered":"https:\/\/data-flair.training\/blogs\/?p=18314"},"modified":"2021-12-04T10:15:24","modified_gmt":"2021-12-04T04:45:24","slug":"scala-extractors","status":"publish","type":"post","link":"https:\/\/data-flair.training\/blogs\/scala-extractors\/","title":{"rendered":"Scala Extractors | Extractors vs Case Classes"},"content":{"rendered":"<p>In this <strong><a href=\"https:\/\/data-flair.training\/blogs\/scala-tutorial\/\">Scala tutorial<\/a><\/strong>, we learned what are Extractors in Scala. Moreover, we will discuss Scala Extractors example. Also, we will discuss unapplySeq and apply the method in Scala extractors. Along with this, we will see how can we use Extractors in pattern matching in Scala. At last, we will learn variable argument Scala Extractors.<\/p>\n<p>So, let&#8217;s start Scala extractors.<\/p>\n<h3>What are Scala Extractors?<\/h3>\n<p><span style=\"font-weight: 400\">A Scala extractor is an object in Scala that defines a method unapply() and optionally a method apply(). One use-case of the apply() method is that Scala invokes it on an instance when we instantiate a class with parentheses with a list of parameters zero or more. While an extractor has other members too, these are what we will discuss here.<\/span><\/p>\n<p><span style=\"font-weight: 400\">An apply() method lets us build values and an unapply() method helps us take them apart. Let\u2019s take an example.<\/span><\/p>\n<p><strong><a href=\"https:\/\/data-flair.training\/blogs\/scala-method-overriding\/\">Read Scala Method Overriding<\/a><\/strong><\/p>\n<h3>An Example of Extractors in Scala<\/h3>\n<p><span style=\"font-weight: 400\">In the following example, we define a method apply() to turn (\u201cAyushi\u201d,\u201dSharma\u201d) into \u201cAyushi Sharma\u201d. unapply() turns this class into an extractor and works to return two strings here from \u201cAyushi Sharma\u201d- the fname and the lname. Where it observes a string other than a name(because there\u2019s no space), it returns None. That is why we make it return an Option.<\/span><\/p>\n<pre class=\"EnlighterJSRAW\">scala&gt; \/\/Optional injection\r\nscala&gt; def apply(fname:String,lname:String)={\r\n    | fname+\" \"+lname\r\n    | }\r\napply: (fname: String, lname: String)String\r\nscala&gt; \/\/Mandatory extraction\r\nscala&gt; def unapply(str:String):Option[(String,String)]={\r\n    | val parts=str split \" \"\r\n    | if(parts.length==2){\r\n    | Some(parts(0),parts(1))\r\n    | }else{\r\n    | None\r\n    | }\r\n    | }\r\nunapply: (str: String)Option[(String, String)]\r\nscala&gt; apply(\"Ayushi\",\"Sharma\")\r\nres4: String = Ayushi Sharma\r\nscala&gt; unapply(\"Ayushi Sharma\")\r\nres5: Option[(String, String)] = Some((Ayushi,Sharma))\r\nscala&gt; unapply(\"AyushiSharma\")\r\nres6: Option[(String, String)] = None<\/pre>\n<h3>Using Scala Extractors for Pattern Matching<\/h3>\n<p><span style=\"font-weight: 400\">Where can we make use of this? One such application is pattern-matching. Before you continue, you should read up on Pattern Matching in Scala.<\/span><\/p>\n<p><strong><a href=\"https:\/\/data-flair.training\/blogs\/scala-pattern-matching\/\">Let&#8217;s explore 14 Types Scala Pattern Matching<\/a><\/strong><\/p>\n<p><span style=\"font-weight: 400\">We can compare Scala extractor objects using a match statement. Here, Scala executes the unapply() method. <\/span><\/p>\n<p><span style=\"font-weight: 400\">Let\u2019s take an example.<\/span><\/p>\n<pre class=\"EnlighterJSRAW\">object Demo{\r\ndef main(args: Array[String]){\r\nval y=Demo(3)\r\n\/\/Apply invoked\r\nprintln(\u201cy: \u201c+y)\r\ny match{\r\ncase Demo(num)=&gt;println(y+\u201d is twice bigger than \u201c+num)\r\n\/\/Unapply invoked\r\ncase _=&gt;println(\u201cSorry\u201d)\r\n}\r\n}\r\ndef apply(y:Int)=y*2\r\ndef unapply(y:Int):Option[Int]=if(y%2==0) Some(y\/2) else None\r\n}<\/pre>\n<p>This gives us the following <strong>output<\/strong>:<br \/>\n<span style=\"font-weight: 400\">y: 6<\/span><br \/>\n<span style=\"font-weight: 400\">6 is twice bigger than 3<\/span><\/p>\n<h3>Variable Argument Extractors in Scala<\/h3>\n<p><span style=\"font-weight: 400\">What happens when we want a Scala extractor that returns a variable number of element values? Let\u2019s try taking a domain apart. A domain may be made of more than two sub-patterns. We can then express such patterns:<\/span><\/p>\n<pre class=\"EnlighterJSRAW\">domain match{\r\ncase Domain(\"ro\",\"versuri\")=&gt;println(\"versuri.ro\")\r\ncase Domain(\"com\", \"sun\", \"java\") =&gt; println(\"java.sun.com\")\r\ncase Domain(\"net\", _*) =&gt; println(\"a .net domain\")<\/pre>\n<p><strong><a href=\"https:\/\/data-flair.training\/blogs\/scala-regex\/\">Let&#8217;s explore Scala Regex | Scala Regular Expressions<\/a><\/strong><br \/>\n<span style=\"font-weight: 400\">Here, we arrange the domains such that we expand them top-down- from the top-level domain to the subdomains. _* is a wildcard pattern that let us match any remaining elements in a sequence.<\/span><br \/>\n<span style=\"font-weight: 400\">To carry out extraction with vararg matching, we can use the method unapplySeq(). This is the Scala extractor object for the same:<\/span><\/p>\n<pre class=\"EnlighterJSRAW\">scala&gt; object Domain{\r\n    | \/\/Optional injection\r\n    | def apply(parts:String*):String=\r\n    | parts.reverse.mkString(\".\")\r\n    |\r\n    | \/\/Mandatory extraction\r\n    | def unapplySeq(whole:String):Option[Seq[String]]=\r\n    | Some(whole.split(\"\\\\.\").reverse)\r\n    | }\r\ndefined object Domain<\/pre>\n<p><span style=\"font-weight: 400\">In this object, the unapplySeq() method splits the string using periods to get an array of substrings. This is an array with all elements reversed and wrapped in a Some.<\/span><\/p>\n<h3>Scala Extractors vs Case Classes<\/h3>\n<p><span style=\"font-weight: 400\">We have seen about case classes in <a href=\"https:\/\/data-flair.training\/blogs\/scala-case-class\/\"><strong>Case Classes and Objects in Scala<\/strong><\/a>. They let us model immutable values. But they represent concrete representation of data. So, the class name in a constructor pattern pertains to the concrete representation type for the selector object.<\/span><\/p>\n<h4>a. Representation Independence<\/h4>\n<p><span style=\"font-weight: 400\">One property of Scala extractors is representation independence. They enable patterns without any relation to the data type for the selected object. This is important in open systems of large size as they let us change implementation type without changing clients. This is where extractors win over case classes in Scala.<\/span><\/p>\n<p><span style=\"font-weight: 400\">However, in some places, case classes have their own advantages over extractors in Scala. It is easier to define them and set them up. They also need less code. Other than that, the compiler patterns over case classes better than it does so over extractors. This makes for more efficient pattern matches for case classes. Finally, there are no exhaustiveness checks for Scala extractors.<\/span><\/p>\n<p><span style=\"font-weight: 400\">Concluding, use a case class when writing for a closed application for conciseness, speed, and static checking. Use extractors when you want to expose a type to unknown clients.<\/span><\/p>\n<p>So, this was all about Scala Extractors. Hope you like our explanation.<\/p>\n<h3>Conclusion<\/h3>\n<p><span style=\"font-weight: 400\">Hence, in this Scala Extractors tutorial, we discussed Extractors in Scala. Where\u00a0it helps us break an object. Moreover, we saw Scala Extractors examples and extractors vs case class. Also, we learned how to use extractors for pattern matching. Is this information helpful to you? Tell us your thoughts in the comments.<\/span><br \/>\nSee also &#8211;<br \/>\n<strong><a href=\"https:\/\/data-flair.training\/blogs\/scala-method-overloading\/\">Scala Method Overloading with Example<\/a><\/strong><br \/>\n<a href=\"https:\/\/www.scala-lang.org\/\"><strong>For reference<\/strong><\/a><span hidden class=\"__iawmlf-post-loop-links\" data-iawmlf-links=\"[{&quot;id&quot;:1904,&quot;href&quot;:&quot;https:\\\/\\\/www.scala-lang.org&quot;,&quot;archived_href&quot;:&quot;http:\\\/\\\/web-wp.archive.org\\\/web\\\/20251206135355\\\/https:\\\/\\\/www.scala-lang.org\\\/&quot;,&quot;redirect_href&quot;:&quot;&quot;,&quot;checks&quot;:[{&quot;date&quot;:&quot;2025-12-10 07:41:44&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2025-12-15 07:30:15&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2025-12-18 15:55:26&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2025-12-23 02:56:25&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2025-12-27 16:24:45&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-01-02 02:40:17&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-01-05 13:44:47&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-01-09 08:06:50&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-01-12 14:24:57&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-01-17 17:26:33&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-01-20 17:57:07&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-01-24 15:52:31&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-01-30 14:21:46&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-02-02 14:58:48&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-02-05 16:39:16&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-02-12 17:17:04&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-02-16 04:52:29&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-02-19 13:39:29&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-02-24 17:10:42&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-02-28 04:44:36&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-03-03 07:25:17&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-03-08 21:46:06&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-03-12 18:02:22&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-03-27 20:15:27&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-04-05 11:05:11&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-04-10 19:22:51&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-04-14 07:59:07&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-04-17 16:14:10&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-04-21 23:18:28&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-04-26 09:13:01&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-04-29 14:23:58&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-05-07 12:16:25&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-05-13 10:20:22&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-05-18 15:54:26&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-05-22 05:55:10&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-05-25 08:30:39&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-05-29 13:12:38&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-06-02 14:06:47&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-06-09 18:23:27&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-06-15 16:29:46&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-06-19 06:54:54&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-06-22 13:14:32&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-06-26 04:09:02&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-06-29 09:04:33&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-07-03 02:40:11&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-07-06 20:59:35&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-07-09 23:42:25&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-07-13 10:49:11&quot;,&quot;http_code&quot;:206}],&quot;broken&quot;:false,&quot;last_checked&quot;:{&quot;date&quot;:&quot;2026-07-13 10:49:11&quot;,&quot;http_code&quot;:206},&quot;process&quot;:&quot;done&quot;}]\"><\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this Scala tutorial, we learned what are Extractors in Scala. Moreover, we will discuss Scala Extractors example. Also, we will discuss unapplySeq and apply the method in Scala extractors. Along with this, we&#46;&#46;&#46;<\/p>\n","protected":false},"author":6,"featured_media":18330,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[61],"tags":[4335,4515,12397,12443,12444,12584,12586],"class_list":["post-18314","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-scala","tag-example-of-scala-extractors","tag-extractors-vs-case-class","tag-scala-apply-method","tag-scala-extractor-object","tag-scala-extractors-examples","tag-scala-unapply-method","tag-scala-unapplyseq"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.0 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Scala Extractors | Extractors vs Case Classes - DataFlair<\/title>\n<meta name=\"description\" content=\"Scala Extractors tutorial: what are Scala extractors, scala extractor example, use of Scala extractor for pattern matching, Scala Extractors vs Case Classes\" \/>\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\/scala-extractors\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Scala Extractors | Extractors vs Case Classes - DataFlair\" \/>\n<meta property=\"og:description\" content=\"Scala Extractors tutorial: what are Scala extractors, scala extractor example, use of Scala extractor for pattern matching, Scala Extractors vs Case Classes\" \/>\n<meta property=\"og:url\" content=\"https:\/\/data-flair.training\/blogs\/scala-extractors\/\" \/>\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=\"2018-06-12T04:08:01+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-12-04T04:45:24+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/06\/Scala-Extractors-01.jpg\" \/>\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\/jpeg\" \/>\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":"Scala Extractors | Extractors vs Case Classes - DataFlair","description":"Scala Extractors tutorial: what are Scala extractors, scala extractor example, use of Scala extractor for pattern matching, Scala Extractors vs Case Classes","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\/scala-extractors\/","og_locale":"en_US","og_type":"article","og_title":"Scala Extractors | Extractors vs Case Classes - DataFlair","og_description":"Scala Extractors tutorial: what are Scala extractors, scala extractor example, use of Scala extractor for pattern matching, Scala Extractors vs Case Classes","og_url":"https:\/\/data-flair.training\/blogs\/scala-extractors\/","og_site_name":"DataFlair","article_publisher":"https:\/\/www.facebook.com\/DataFlairWS\/","article_published_time":"2018-06-12T04:08:01+00:00","article_modified_time":"2021-12-04T04:45:24+00:00","og_image":[{"width":1200,"height":628,"url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/06\/Scala-Extractors-01.jpg","type":"image\/jpeg"}],"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\/scala-extractors\/#article","isPartOf":{"@id":"https:\/\/data-flair.training\/blogs\/scala-extractors\/"},"author":{"name":"DataFlair Team","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/person\/2c58ecb4f73a39f0ef993f1ddfcd7b89"},"headline":"Scala Extractors | Extractors vs Case Classes","datePublished":"2018-06-12T04:08:01+00:00","dateModified":"2021-12-04T04:45:24+00:00","mainEntityOfPage":{"@id":"https:\/\/data-flair.training\/blogs\/scala-extractors\/"},"wordCount":704,"commentCount":0,"publisher":{"@id":"https:\/\/data-flair.training\/blogs\/#organization"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/scala-extractors\/#primaryimage"},"thumbnailUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/06\/Scala-Extractors-01.jpg","keywords":["Example of Scala Extractors","extractors vs case class","Scala apply method","Scala Extractor object","Scala Extractors examples","scala unapply method","Scala unapplyseq"],"articleSection":["Scala Tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/data-flair.training\/blogs\/scala-extractors\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/data-flair.training\/blogs\/scala-extractors\/","url":"https:\/\/data-flair.training\/blogs\/scala-extractors\/","name":"Scala Extractors | Extractors vs Case Classes - DataFlair","isPartOf":{"@id":"https:\/\/data-flair.training\/blogs\/#website"},"primaryImageOfPage":{"@id":"https:\/\/data-flair.training\/blogs\/scala-extractors\/#primaryimage"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/scala-extractors\/#primaryimage"},"thumbnailUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/06\/Scala-Extractors-01.jpg","datePublished":"2018-06-12T04:08:01+00:00","dateModified":"2021-12-04T04:45:24+00:00","description":"Scala Extractors tutorial: what are Scala extractors, scala extractor example, use of Scala extractor for pattern matching, Scala Extractors vs Case Classes","breadcrumb":{"@id":"https:\/\/data-flair.training\/blogs\/scala-extractors\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/data-flair.training\/blogs\/scala-extractors\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/data-flair.training\/blogs\/scala-extractors\/#primaryimage","url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/06\/Scala-Extractors-01.jpg","contentUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/06\/Scala-Extractors-01.jpg","width":1200,"height":628,"caption":"Scala Extractors | Extractors vs Case Classes"},{"@type":"BreadcrumbList","@id":"https:\/\/data-flair.training\/blogs\/scala-extractors\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Blog Home","item":"https:\/\/data-flair.training\/blogs\/"},{"@type":"ListItem","position":2,"name":"Scala Tutorials","item":"https:\/\/data-flair.training\/blogs\/category\/scala\/"},{"@type":"ListItem","position":3,"name":"Scala Extractors | Extractors vs Case Classes"}]},{"@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\/2c58ecb4f73a39f0ef993f1ddfcd7b89","name":"DataFlair Team","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/1ce4a0e3e542444fc73bbebf83e89e8b73e2d95ccb1fcee64da9945f078b97c5?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/1ce4a0e3e542444fc73bbebf83e89e8b73e2d95ccb1fcee64da9945f078b97c5?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/1ce4a0e3e542444fc73bbebf83e89e8b73e2d95ccb1fcee64da9945f078b97c5?s=96&d=mm&r=g","caption":"DataFlair Team"},"description":"The DataFlair Team provides industry-driven content on programming, Java, Python, C++, DSA, AI, ML, data Science, Android, Flutter, MERN, Web Development, and technology. Our expert educators focus on delivering value-packed, easy-to-follow resources for tech enthusiasts and professionals.","url":"https:\/\/data-flair.training\/blogs\/author\/dfteam2\/"}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/18314","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\/6"}],"replies":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/comments?post=18314"}],"version-history":[{"count":6,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/18314\/revisions"}],"predecessor-version":[{"id":104735,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/18314\/revisions\/104735"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/media\/18330"}],"wp:attachment":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/media?parent=18314"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/categories?post=18314"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/tags?post=18314"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}