

{"id":12380,"date":"2018-03-31T06:28:37","date_gmt":"2018-03-31T06:28:37","guid":{"rendered":"https:\/\/data-flair.training\/blogs\/?p=12380"},"modified":"2026-05-16T17:19:29","modified_gmt":"2026-05-16T11:49:29","slug":"switch-statement-in-java","status":"publish","type":"post","link":"https:\/\/data-flair.training\/blogs\/switch-statement-in-java\/","title":{"rendered":"Switch Case in Java with Example"},"content":{"rendered":"<p>If you have been following the articles, you would know what we would be doing before we progress into the details of the subject.<\/p>\n<p>Yes, we would look at a real-life example.<\/p>\n<p>Imagine you are in charge of writing code for a huge MNC where there is not one, not two, but 60 ways that a program\u2019s execution can change based on the user\u2019s input. Now, you as a programmer would have to write 60 if-else statements and write the flow of the program accordingly for each case. Right? Well, yes, you would have to if you did not know about the \u201cSwitch\u201d statement in Java.<\/p>\n<p>You would be a very bad programmer if you did not know about switch statements in the first place, but for the sake of the example, let\u2019s say that you are not familiar with the concept.<\/p>\n<p>Well, Java\u2019s switch statement can save you from writing redundant lines of code.<\/p>\n<p>Let us dive in!<\/p>\n<h3>What is a Switch Case in Java?<\/h3>\n<p>Switch case in Java is essential for avoiding redundant if-else statements in a program.<\/p>\n<p>You can branch into multiple ways by using this statement.<\/p>\n<p>Think of this as a road intersection where you can branch off into three different directions from a single point.<\/p>\n<p>&nbsp;<\/p>\n<p><strong>Syntax of Java Switch Case:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">switch(variable_name)\r\n{\r\n    case value1:\r\n    \/\/code to be executed if variable_name=value1\r\n    break;\r\n    case value2:\r\n    \/\/code to be executed if variable_name=value2\r\n    break;\r\n\r\n    default:\r\n    \/\/code to be executed if variable_name=value3\r\n}\r\n\r\n<\/pre>\n<p>It works with Java Enums, Wrapper classes, and the String class as well.<\/p>\n<p><strong>Points to note while using switch statements in Java:<\/strong><\/p>\n<ul>\n<li>You cannot have duplicate case values.<\/li>\n<li>The datatype of the case must be the same as the data type of the switch.<\/li>\n<li>The limiting value of a case should either be a constant or a literal. You cannot add variables to the case.<\/li>\n<li>The break is useful for terminating the flow of the program after a particular case has been executed.<\/li>\n<li>If you do not use the break statement, the flow of the control progresses to the next case.<\/li>\n<li>The default case can appear anywhere inside the switch block. However, if it contains case blocks after it, a break statement should be added after the default block; otherwise, the control would slip into the next layers of the block.<\/li>\n<\/ul>\n<p><strong>Java example to illustrate the use of Switch Case:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">package com.dataflair.switchcase;\r\nimport java.util.*;\r\n\r\npublic class SwitchStatement {\r\n\r\n    public static void main(String[] args) {\r\n        \r\n        Scanner sc = new Scanner(System.in);\r\n\r\n        int variable;\r\n        System.out.println(\"Please enter the variable value\");\r\n        \r\n        variable=sc.nextInt();\r\n\r\n        switch(variable)\r\n        {\r\n            case 1:\r\n            System.out.println(\"The value of the variable = \"+variable);\r\n            break;\r\n            case 2:\r\n            System.out.println(\"The value of the variable =\"+variable);\r\n            break;\r\n            case 3:\r\n            System.out.println(\"The value of the variable =\"+variable);\r\n            break;\r\n            default:\r\n            System.out.println(\"The value of the variable is neither 1 nor 2 nor 3\");\r\n        }\r\n\r\n    }\r\n}\r\n<\/pre>\n<p><strong>Output:<\/strong><\/p>\n<div class=\"code-output\">Please enter the variable value<br \/>\n5<br \/>\nThe value of the variable is neither 1 nor 2 nor 3<\/div>\n<p><strong>Java program to illustrate what the break statement is useful for:<\/strong><\/p>\n<p>We can also try to see what happens if we remove the break statement<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">package com.dataflair.switchcase;\r\nimport java.util.*;\r\n\r\npublic class SwitchStatement {\r\n\r\n    public static void main(String[] args) {\r\n        \r\n        Scanner sc = new Scanner(System.in);\r\n\r\n        int variable;\r\n        System.out.println(\"Please enter the variable value\");\r\n        \r\n        variable=sc.nextInt();\r\n\r\n        switch(variable)\r\n        {\r\n            case 1:\r\n            System.out.println(\"The value of the variable = \"+variable);\r\n            case 2:\r\n            System.out.println(\"The value of the variable = \"+variable);\r\n            case 3:\r\n            System.out.println(\"Value of the variable = \"+variable);\r\n            default:\r\n            System.out.println(\"The value of the variable is neither 1 nor 2 nor 3\");\r\n        }\r\n\r\n    }\r\n}\r\n\r\n<\/pre>\n<p><strong>Output:<\/strong><\/p>\n<div class=\"code-output\">Please enter the variable value<br \/>\n1The value of the variable = 1<br \/>\nThe value of the variable = 1<br \/>\nValue of the variable = 1<br \/>\nThe value of the variable is neither 1 nor 2 nor 3<\/div>\n<p><strong>Java program to illustrate the use of switch statements with strings:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">package com.dataflair.java.switchcase;\r\npublic class SwitchStrings\r\n{\r\n    public static void main(String[] args) {\r\n        String course=\"java\";\r\n        switch(course)\r\n        {\r\n            case \"python\":\r\n                System.out.println(\"Python was made by Guido Van Rossum\");\r\n                break;\r\n            case \"java\":\r\n                System.out.println(\"Java was made by James Gosling! It is one of Shraman's favourites!\");\r\n                break;\r\n            case \"c++\":\r\n                System.out.println(\"C ++ was made by Bjarne Stroustrup\");\r\n                break;\r\n            \r\n        }\r\n    }\r\n}\r\n<\/pre>\n<p><strong>Output:<\/strong><\/p>\n<div class=\"code-output\">Java was made by James Gosling! It is one of Shraman&#8217;s favourites!<\/div>\n<p><strong>Java program to illustrate the nested switch case:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">package com.dataflair.switchcase;\r\nimport java.util.*;\r\n\r\npublic class NestedSwitch\r\n{\r\n    public static void main(String[] args) {\r\n        Scanner sc = new Scanner(System.in);\r\n        \r\n        String course=\"java\";\r\n        switch(course)\r\n        {\r\n            case \"python\":\r\n                System.out.println(\"Python was made by Guido Van Rossum\");\r\n                break;\r\n            case \"java\":\r\n                System.out.println(\"What version of Java are you using?\");\r\n                int version=sc.nextInt();\r\n                switch(version)\r\n                {\r\n                    case 6:\r\n                        System.out.println(\"That is old school!\");\r\n                        break;\r\n                    case 8:\r\n                        System.out.println(\"Wow, that\u2019s great! Tons of new features!\");\r\n                        break;\r\n                    \r\n                }\r\n                break;\r\n            case \"c++\":\r\n                System.out.println(\"C ++ was made by Bjarne Stroustrup\");\r\n                break;\r\n            \r\n        }\r\n    }\r\n}\r\n\r\n<\/pre>\n<p><strong>Output:<\/strong><\/p>\n<div class=\"code-output\">What version of Java are you using?<br \/>\n8<br \/>\nWow, that\u2019s great! Tons of new features!<\/div>\n<p><strong>Java program to illustrate the use of switch case with enum:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">package com.dataflair.switchcase;\r\n\r\nimport java.util.*;\r\n\r\npublic class SwitchEnum\r\n{\r\n    \r\n        enum course \r\n        {\r\n            AI,ML,WD\r\n            \r\n        }\r\n    public static void main(String[] args) {\r\n        Scanner sc = new Scanner(System.in);\r\n        \r\n        course[] presentcourse = course.values();    \r\n        \r\n       for(course c:presentcourse)\r\n       {\r\n           switch(c)\r\n           {\r\n               case AI:\r\n                    System.out.println(\"The full form of AI is Artificial Intelligence\");\r\n                    break;\r\n               case ML:\r\n                   System.out.println(\"Full form of ML is Machine Learning\");\r\n                   break;\r\n                case WD:\r\n                    System.out.println(\"The full form of WD is Web Development\");\r\n                    break;\r\n                    \r\n           }\r\n           \r\n       }\r\n    }\r\n}\r\n\r\n<\/pre>\n<p><strong>Output:<\/strong><\/p>\n<div class=\"code-output\">The full form of AI is Artificial Intelligence<br \/>\nFull form of ML is Machine Learning<br \/>\nThe full form of WD is Web Development<\/div>\n<p><strong>Java program to illustrate the use of switch case with Wrapper classes:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">package com.dataflair.javaswitch;\r\n\r\nimport java.util.*;\r\n\r\npublic class WrapperSwitch\r\n{\r\n    public static void main(String[] args) {\r\n        Integer choice;\r\n        System.out.println(\"1. Java\\n 2. Python\\n 3.C++\\n\");\r\n        Scanner sc = new Scanner(System.in);\r\n        choice=sc.nextInt();\r\n        \r\n        switch(choice)\r\n        {\r\n            case 1:\r\n                System.out.println(\"Java requires a good knowledge of Object Oriented Programming\");\r\n                break;\r\n            case 2:\r\n                System.out.println(\"Easiest language to learn. Known as executable pseudocode\");\r\n                break;\r\n            case 3:\r\n                System.out.println(\"Best language for competitive programming\");\r\n                break;\r\n            default:\r\n                System.out.println(\"Wrong choice\");\r\n            \r\n        }\r\n    }\r\n}\r\n\r\n<\/pre>\n<p><strong>Output:<\/strong><\/p>\n<div class=\"code-output\">1. Java<br \/>\n2. Python<br \/>\n3.C++2<br \/>\nEasiest language to learn. Known as executable pseudocode<\/div>\n<h3>Rules of Switch Case Statement in Java<\/h3>\n<p>There are a few rules that have to be understood while using switch case statements in Java.<\/p>\n<ul>\n<li>You can only use integers, strings, and enums as the case values in a switch case statement.<\/li>\n<li>There is no limit to the number of cases in a switch case block. You can have as many as you want. Each case block is followed by the value of the case and a colon. Then comes the code to be executed when the case is true.<\/li>\n<li>You have to keep in mind that the value and the data type of the value must be the same as the variable in the switch block.<\/li>\n<li>You cannot have expressions in cases. The value must either be literal or constant.<\/li>\n<li>Once a case evaluates to true, the compiler will execute all the statements line by line until it reads a break statement.<\/li>\n<li>As soon as the compiler goes through a break statement, the control shifts to the lines after the switch block.<\/li>\n<li>In Java, the switch case is fall-through in nature. This means that the control of the program will continue to go through all the cases if no break statement is present in a case block.<\/li>\n<li>If no case evaluates to true, the default case(if present) gets executed.<\/li>\n<li>All of the case values must be unique.<\/li>\n<\/ul>\n<h4>Flow Diagram for Java Switch Case<\/h4>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/03\/Flow-diagram-for-the-Switch-Case.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-84885\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/03\/Flow-diagram-for-the-Switch-Case.jpg\" alt=\"Flow diagram for the Switch Case\" width=\"1200\" height=\"1400\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/03\/Flow-diagram-for-the-Switch-Case.jpg 1200w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/03\/Flow-diagram-for-the-Switch-Case-257x300.jpg 257w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/03\/Flow-diagram-for-the-Switch-Case-878x1024.jpg 878w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/03\/Flow-diagram-for-the-Switch-Case-129x150.jpg 129w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/03\/Flow-diagram-for-the-Switch-Case-768x896.jpg 768w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/03\/Flow-diagram-for-the-Switch-Case-720x840.jpg 720w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/03\/Flow-diagram-for-the-Switch-Case-520x607.jpg 520w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/03\/Flow-diagram-for-the-Switch-Case-320x373.jpg 320w\" sizes=\"auto, (max-width: 1200px) 100vw, 1200px\" \/><\/a><\/p>\n<h3>Benefits of Java Switch Statement<\/h3>\n<p><strong>1. Improved Readability:<\/strong> Switch statements consolidate multiple conditions into a single block, making code easier to understand and follow.<\/p>\n<p><strong>2. Enhanced Efficiency:<\/strong> In certain situations, compilers can optimize switch statements for faster execution compared to complex if-else chains.<\/p>\n<p><strong>3. Reduced Errors:<\/strong> By explicitly listing every possible scenario within the switch statement, the chance of accidentally omitting a condition is minimized.<\/p>\n<p><strong>4. Easier maintenance:<\/strong> As the statements are separated in a hierarchical structure, it simplifies the changes in the code.<\/p>\n<p><strong>5. Flexibility:<\/strong> It provides flexibility to the code by providing break and continue statements.<\/p>\n<p><strong>6.<\/strong> <strong>For Multitasking:<\/strong> Useful when multiple tasks are required to be performed differently.<\/p>\n<h3>Summary<\/h3>\n<p>In this article, we learned about the various applications of switch statements in Java.<\/p>\n<p>Java Switch case is extremely useful when we want to avoid if-else ladders.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>If you have been following the articles, you would know what we would be doing before we progress into the details of the subject. Yes, we would look at a real-life example. Imagine you&#46;&#46;&#46;<\/p>\n","protected":false},"author":5,"featured_media":84884,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[32],"tags":[20662,20661,20660,7708],"class_list":["post-12380","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-java","tag-example-of-switch-statement","tag-implementation-of-switch-case","tag-java-switch-case","tag-java-switch-statement"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.8 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Switch Case in Java with Example - DataFlair<\/title>\n<meta name=\"description\" content=\"Switch Case in Java helps programmer in better decision making. Learn syntax and implementation of Switch case &amp; nested switch with examples.\" \/>\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\/switch-statement-in-java\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Switch Case in Java with Example - DataFlair\" \/>\n<meta property=\"og:description\" content=\"Switch Case in Java helps programmer in better decision making. Learn syntax and implementation of Switch case &amp; nested switch with examples.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/data-flair.training\/blogs\/switch-statement-in-java\/\" \/>\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-03-31T06:28:37+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-05-16T11:49:29+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/03\/Java-Switch-Statement.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=\"5 minutes\" \/>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Switch Case in Java with Example - DataFlair","description":"Switch Case in Java helps programmer in better decision making. Learn syntax and implementation of Switch case & nested switch with examples.","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\/switch-statement-in-java\/","og_locale":"en_US","og_type":"article","og_title":"Switch Case in Java with Example - DataFlair","og_description":"Switch Case in Java helps programmer in better decision making. Learn syntax and implementation of Switch case & nested switch with examples.","og_url":"https:\/\/data-flair.training\/blogs\/switch-statement-in-java\/","og_site_name":"DataFlair","article_publisher":"https:\/\/www.facebook.com\/DataFlairWS\/","article_published_time":"2018-03-31T06:28:37+00:00","article_modified_time":"2026-05-16T11:49:29+00:00","og_image":[{"width":1200,"height":628,"url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/03\/Java-Switch-Statement.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":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/data-flair.training\/blogs\/switch-statement-in-java\/#article","isPartOf":{"@id":"https:\/\/data-flair.training\/blogs\/switch-statement-in-java\/"},"author":{"name":"DataFlair Team","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/person\/7f83c342f5d1632d6f7b4b0b0f447823"},"headline":"Switch Case in Java with Example","datePublished":"2018-03-31T06:28:37+00:00","dateModified":"2026-05-16T11:49:29+00:00","mainEntityOfPage":{"@id":"https:\/\/data-flair.training\/blogs\/switch-statement-in-java\/"},"wordCount":918,"commentCount":4,"publisher":{"@id":"https:\/\/data-flair.training\/blogs\/#organization"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/switch-statement-in-java\/#primaryimage"},"thumbnailUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/03\/Java-Switch-Statement.jpg","keywords":["Example of Switch Statement","Implementation of Switch case","Java Switch Case","Java Switch Statement"],"articleSection":["Java Tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/data-flair.training\/blogs\/switch-statement-in-java\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/data-flair.training\/blogs\/switch-statement-in-java\/","url":"https:\/\/data-flair.training\/blogs\/switch-statement-in-java\/","name":"Switch Case in Java with Example - DataFlair","isPartOf":{"@id":"https:\/\/data-flair.training\/blogs\/#website"},"primaryImageOfPage":{"@id":"https:\/\/data-flair.training\/blogs\/switch-statement-in-java\/#primaryimage"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/switch-statement-in-java\/#primaryimage"},"thumbnailUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/03\/Java-Switch-Statement.jpg","datePublished":"2018-03-31T06:28:37+00:00","dateModified":"2026-05-16T11:49:29+00:00","description":"Switch Case in Java helps programmer in better decision making. Learn syntax and implementation of Switch case & nested switch with examples.","breadcrumb":{"@id":"https:\/\/data-flair.training\/blogs\/switch-statement-in-java\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/data-flair.training\/blogs\/switch-statement-in-java\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/data-flair.training\/blogs\/switch-statement-in-java\/#primaryimage","url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/03\/Java-Switch-Statement.jpg","contentUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/03\/Java-Switch-Statement.jpg","width":1200,"height":628,"caption":"Java Switch Case Statement"},{"@type":"BreadcrumbList","@id":"https:\/\/data-flair.training\/blogs\/switch-statement-in-java\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Blog Home","item":"https:\/\/data-flair.training\/blogs\/"},{"@type":"ListItem","position":2,"name":"Java Tutorials","item":"https:\/\/data-flair.training\/blogs\/category\/java\/"},{"@type":"ListItem","position":3,"name":"Switch Case in Java with Example"}]},{"@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\/7f83c342f5d1632d6f7b4b0b0f447823","name":"DataFlair Team","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/4cf3a74600d131330b8c481d519afd1574093ed89f6d3396a95393ad223eb7cd?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/4cf3a74600d131330b8c481d519afd1574093ed89f6d3396a95393ad223eb7cd?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/4cf3a74600d131330b8c481d519afd1574093ed89f6d3396a95393ad223eb7cd?s=96&d=mm&r=g","caption":"DataFlair Team"},"description":"DataFlair Team creates expert-level guides on programming, Java, Python, C++, DSA, AI, ML, data Science, Android, Flutter, MERN, Web Development, and technology. Our goal is to empower learners with easy-to-understand content. Explore our resources for career growth and practical learning.","url":"https:\/\/data-flair.training\/blogs\/author\/dfteam1\/"}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/12380","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\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/comments?post=12380"}],"version-history":[{"count":18,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/12380\/revisions"}],"predecessor-version":[{"id":148299,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/12380\/revisions\/148299"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/media\/84884"}],"wp:attachment":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/media?parent=12380"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/categories?post=12380"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/tags?post=12380"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}