{"id":13476,"date":"2020-03-18T14:58:32","date_gmt":"2020-03-18T21:58:32","guid":{"rendered":"https:\/\/careerkarma.com\/blog\/?p=13476"},"modified":"2023-12-01T02:33:10","modified_gmt":"2023-12-01T10:33:10","slug":"java-switch-statement","status":"publish","type":"post","link":"https:\/\/careerkarma.com\/blog\/java-switch-statement\/","title":{"rendered":"Switch Statement Java: How to Use It"},"content":{"rendered":"\n<p>Conditional statements are a common feature in all programming languages. We use conditional statements to control the flow of programs. In Java, <code>if...else<\/code> statements are used to control program flow based on a certain set of conditions.<br><\/p>\n\n\n\n<p>Additionally, Java offers a feature called the <code>switch<\/code> statement, which will evaluate an expression against multiple cases. If a statement matches a specified case, the block of code corresponding to that case will be executed.<br><\/p>\n\n\n\n<p>In this tutorial, we\u2019ll discuss how to use the \u201cswitch\u201d statement in Java, and how to use the <code>default<\/code>, <code>case<\/code> and <code>break<\/code> keywords. We\u2019ll also walk through an example of these keywords being used in a Java switch statement.<br><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Conditional Statements Refresher<\/h2>\n\n\n\n<p>Conditional statements allow programs to execute code when a certain condition evaluates to True. For instance, a conditional statement could tell a program to run a block of code only if the variable <code>name<\/code> contained the letter <code>F.<\/code><br><\/p>\n\n\n\n<p>In Java, there are two conditional statements you can use to control the flow of your code: <code>if...else<\/code> statements and <code>switch<\/code> statements.<br><\/p>\n\n\n\n<p><code>if...else<\/code> statements execute a block of code if a condition evaluates to true. Here\u2019s an example of an <code>if<\/code> statement in Java:<br><\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>if (15 &gt; 5) {\n\tSystem.out.println(\"15 is greater than 5.\");\n};\n<\/pre><\/div>\n\n\n\n<p>Our code evaluates the expression <code>15 &gt; 5<\/code>, which is true, and so returns the following:<br><\/p>\n\n\n\n<p><code>15 is greater than 5.<br><\/code><\/p>\n\n\n\n<p>Additionally, you can specify <code>else<\/code> blocks, which will run code if all conditions evaluate to false, and <code>else...if<\/code> blocks which specify a new condition to test if the first condition is false.<br><\/p>\n\n\n\n<p>The <code>switch<\/code> statement can also be used to perform a conditional evaluation in your code.<br><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Switch Statement Java<\/h2>\n\n\n\n<p>The Java <code>switch<\/code> statement is used to evaluate a statement against one or more conditions and will execute the blocks of code corresponding to the conditions that evaluate to True.&nbsp;<br><\/p>\n\n\n\n<p>The <code>switch<\/code> statement contains a <code>case<\/code> statement, which is used to specify conditions against which an expression should be evaluated. Here\u2019s the syntax for a Java switch statement:<br><\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>switch(expression) {\n\tcase a:\n\t\tbreak;\n\tcase b:\n\t\tbreak;\n\tcase c:\n\t\tbreak;\n\tdefault:\n\t\tbreak;\n}\n<\/pre><\/div>\n\n\n\n<p>Let\u2019s break down how it works.<br><\/p>\n\n\n\n<p>The expression contained in the switch statement is evaluated once. Then, the value of the expression is compared with the values of each <code>case<\/code>, starting from the top of the switch statement. If the expression matches a case, the block of code associated with the case statement is executed. If an expression does not match a case, the subsequent case label will be evaluated.<br><\/p>\n\n\n\n<p>If none of our conditions evaluate to true, the contents of the <code>default<\/code> statement will be executed.&nbsp;<br><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Switch Statement Example<\/h2>\n\n\n\n<p>We\u2019ll walk through a working example of the switch statement to illustrate how it works. Let\u2019s say we want to create a program that tells us the name of the month based on the numeric value of the month. We only want our program to work with the first six months of the year.<br><\/p>\n\n\n\n<p>To create this program, we\u2019ll use the <code>time.LocalDate<\/code> Java method to get the numeric value corresponding to this month. The number 1 represents January, 2 represents February, and so on.<br><\/p>\n\n\n\n<p>Before we begin, we\u2019ll first need to set up the code that gets the numeric value corresponding to this month. Here\u2019s the code we can use to retrieve this data:<br><\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>LocalDate today = LocalDate.now();\nint month = today.getMonthValue();\nSystem.out.println(month);\n<\/pre><\/div>\n\n\n\n<p>Our code returns the numeric value which represents the current month, which in this case is 2 (this article was written in February).<br><\/p>\n\n\n\n<p>Using the <code>switch<\/code> statement, we can send a message to the console with the name of the month based on the numeric value we have calculated in our code above. The program will run from top to bottom and look for a match. Once a match is found, the <code>break<\/code> statement will stop the <code>switch<\/code> statement and continue executing the program.<br><\/p>\n\n\n\n<p>Here\u2019s the code we could use for our calendar program:<br><\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>LocalDate today = LocalDate.now();\nint month = today.getMonthValue();\nswitch (month) {\n\tcase 1:\n\t\tSystem.out.println(\"January\");\n\t\tbreak;\n\tcase 2:\n\t\tSystem.out.println(\"February\");\n\t\tbreak;\n\tcase 3:\n\t\tSystem.out.println(\"March\");\n\t\tbreak;\n\tcase 4:\n\t\tSystem.out.println(\"April\");\n\t\tbreak;\n\tcase 5:\n\t\tSystem.out.println(\"May\");\n\t\tbreak;\n\tcase 6:\n\t\tSystem.out.println(\"June\");\n\t\tbreak;\n}\n<\/pre><\/div>\n\n\n\n<p>When we execute our code, the following response is returned: <code>February<\/code>.<br><\/p>\n\n\n\n<p>Let\u2019s break down how our code works. At the start, we use the LocalDate method to get the numeric value, which represents this month. Then, we define a <code>switch<\/code> statement that has six cases.<br><\/p>\n\n\n\n<p>The program executes each case one-by-one until it finds one that evaluates to true. In this case, the <code>case 2<\/code> statement evaluates to true, because it\u2019s February, which has the numeric value 2. Then, our program prints out the name of the month to the console and executes a <code>break<\/code> statement, which stops our program from continuing.<br><\/p>\n\n\n\n<p>If it was May, for example, the month value would be 5, and so <code>May<\/code> would be printed to the console.<br><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Break Keyword<\/h2>\n\n\n\n<p>In our code above, we used the <code>break<\/code> keyword. When Java executes a <code>break<\/code> statement, it\u2019ll stop running the code within the <code>switch<\/code> block and continue running the program.<br><\/p>\n\n\n\n<p>This statement is important because it stops a program from testing for more cases when a case has already been met. This saves time on execution because the program doesn\u2019t need to evaluate more cases after the right case has been found. You should use <code>break<\/code> statements at the end of every <code>case<\/code>.<br><\/p>\n\n\n\n<p>Here\u2019s an example of the <code>break<\/code> statement from our code above:<br><\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>\u2026\n\tcase 4:\n\t\tSystem.out.println(\"April\");\n\t\tbreak;\n\u2026\n<\/pre><\/div>\n\n\n\n<p>If it was April, this case would be executed, and then the program would break out of the switch statement because a <code>break<\/code> statement is present.<br><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Default Keyword<\/h2>\n\n\n\n<p>The <code>default<\/code> keyword is used to specify code that should be run if no case is found. In our example above, we defined a program that returns the name of a month, but only if it\u2019s between January and June.<br><\/p>\n\n\n\n<p>But what if we want our user to be presented with a default message stating, <code>It\u2019s after June<\/code> if no case evaluates to true? That\u2019s where the <code>default<\/code> keyword comes in.<br><\/p>\n\n\n\n<p>Here\u2019s an example of the <code>default<\/code> keyword being used with the above example to specify a message that will appear if no cases evaluate to true:<br><\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>case 4:\n\t\tSystem.out.println(\"April\");\n\t\tbreak;\n\tcase 5:\n\t\tSystem.out.println(\"May\");\n\t\tbreak;\n\tcase 6:\n\t\tSystem.out.println(\"June\");\n\t\tbreak;\n\tdefault:\n\t\tSystem.out.println(\"It's after June!\")\n\t\tbreak;\n\u2026\n<\/pre><\/div>\n\n\n\n<p>If it were July and we were to execute our program, the contents of the <code>default<\/code> statement would be executed because no case would evaluate to true. Then, the message <code>It\u2019s after June!<\/code> would be printed to the console.<br><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Conclusion<\/h2>\n\n\n\n<p>The Java switch statement is used to evaluate a statement against multiple cases and execute code if a particular case is met. Switch statements are a form of conditional statement used to control the flow of a program.<br><\/p>\n\n\n\n<p>This tutorial discussed how to use a <code>switch<\/code> statement in Java, and explored how to use the <code>case<\/code>, <code>break<\/code>, and <code>default<\/code> statements with the <code>switch<\/code> method. Further, we walked through an example of a switch statement in action, which uses these keywords.<br><\/p>\n\n\n\n<p>Now you\u2019re ready to use switch statements in Java like an expert!<\/p>\n","protected":false},"excerpt":{"rendered":"Conditional statements are a common feature in all programming languages. We use conditional statements to control the flow of programs. In Java, if...else statements are used to control program flow based on a certain set of conditions. Additionally, Java offers a feature called the switch statement, which will evaluate an expression against multiple cases. If&hellip;","protected":false},"author":240,"featured_media":12814,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[17289],"tags":[],"class_list":{"0":"post-13476","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-java"},"acf":{"post_sub_title":"","sprint_id":"","query_class":"Java","school_sft":"","parent_sft":"","school_privacy_policy":"","has_review":"","is_sponser_post":"","is_guest_post":""},"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v27.0 (Yoast SEO v27.0) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Switch Statement Java: How to Use It | Career Karma<\/title>\n<meta name=\"description\" content=\"The switch statement is used in Java to execute code when a condition evaluates to true. Learn how to use the switch statement in this article.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/careerkarma.com\/blog\/java-switch-statement\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Switch Statement Java: How to Use It\" \/>\n<meta property=\"og:description\" content=\"The switch statement is used in Java to execute code when a condition evaluates to true. Learn how to use the switch statement in this article.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/careerkarma.com\/blog\/java-switch-statement\/\" \/>\n<meta property=\"og:site_name\" content=\"Career Karma\" \/>\n<meta property=\"article:publisher\" content=\"http:\/\/facebook.com\/careerkarmaapp\" \/>\n<meta property=\"article:published_time\" content=\"2020-03-18T21:58:32+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-12-01T10:33:10+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/03\/adult-apple-device-business-code-340152.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1000\" \/>\n\t<meta property=\"og:image:height\" content=\"563\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"James Gallagher\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@career_karma\" \/>\n<meta name=\"twitter:site\" content=\"@career_karma\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"James Gallagher\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/careerkarma.com\/blog\/java-switch-statement\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/java-switch-statement\/\"},\"author\":{\"name\":\"James Gallagher\",\"@id\":\"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/e79364792443fbff794a144c67ec8e94\"},\"headline\":\"Switch Statement Java: How to Use It\",\"datePublished\":\"2020-03-18T21:58:32+00:00\",\"dateModified\":\"2023-12-01T10:33:10+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/java-switch-statement\/\"},\"wordCount\":1063,\"commentCount\":0,\"image\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/java-switch-statement\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/03\/adult-apple-device-business-code-340152.jpg\",\"articleSection\":[\"Java\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/careerkarma.com\/blog\/java-switch-statement\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/careerkarma.com\/blog\/java-switch-statement\/\",\"url\":\"https:\/\/careerkarma.com\/blog\/java-switch-statement\/\",\"name\":\"Switch Statement Java: How to Use It | Career Karma\",\"isPartOf\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/java-switch-statement\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/java-switch-statement\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/03\/adult-apple-device-business-code-340152.jpg\",\"datePublished\":\"2020-03-18T21:58:32+00:00\",\"dateModified\":\"2023-12-01T10:33:10+00:00\",\"author\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/e79364792443fbff794a144c67ec8e94\"},\"description\":\"The switch statement is used in Java to execute code when a condition evaluates to true. Learn how to use the switch statement in this article.\",\"breadcrumb\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/java-switch-statement\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/careerkarma.com\/blog\/java-switch-statement\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/careerkarma.com\/blog\/java-switch-statement\/#primaryimage\",\"url\":\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/03\/adult-apple-device-business-code-340152.jpg\",\"contentUrl\":\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/03\/adult-apple-device-business-code-340152.jpg\",\"width\":1000,\"height\":563},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/careerkarma.com\/blog\/java-switch-statement\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Blog\",\"item\":\"https:\/\/careerkarma.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Java\",\"item\":\"https:\/\/careerkarma.com\/blog\/java\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Switch Statement Java: How to Use It\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/careerkarma.com\/blog\/#website\",\"url\":\"https:\/\/careerkarma.com\/blog\/\",\"name\":\"Career Karma\",\"description\":\"Latest Coding Bootcamp News &amp; Career Hacks from Industry Insiders\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/careerkarma.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/e79364792443fbff794a144c67ec8e94\",\"name\":\"James Gallagher\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/01\/james-gallagher-150x150.jpg\",\"contentUrl\":\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/01\/james-gallagher-150x150.jpg\",\"caption\":\"James Gallagher\"},\"description\":\"James Gallagher is a self-taught programmer and the technical content manager at Career Karma. He has experience in range of programming languages and extensive expertise in Python, HTML, CSS, and JavaScript. James has written hundreds of programming tutorials, and he frequently contributes to publications like Codecademy, Treehouse, Repl.it, Afrotech, and others.\",\"url\":\"https:\/\/careerkarma.com\/blog\/author\/jamesgallagher\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Switch Statement Java: How to Use It | Career Karma","description":"The switch statement is used in Java to execute code when a condition evaluates to true. Learn how to use the switch statement in this article.","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:\/\/careerkarma.com\/blog\/java-switch-statement\/","og_locale":"en_US","og_type":"article","og_title":"Switch Statement Java: How to Use It","og_description":"The switch statement is used in Java to execute code when a condition evaluates to true. Learn how to use the switch statement in this article.","og_url":"https:\/\/careerkarma.com\/blog\/java-switch-statement\/","og_site_name":"Career Karma","article_publisher":"http:\/\/facebook.com\/careerkarmaapp","article_published_time":"2020-03-18T21:58:32+00:00","article_modified_time":"2023-12-01T10:33:10+00:00","og_image":[{"width":1000,"height":563,"url":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/03\/adult-apple-device-business-code-340152.jpg","type":"image\/jpeg"}],"author":"James Gallagher","twitter_card":"summary_large_image","twitter_creator":"@career_karma","twitter_site":"@career_karma","twitter_misc":{"Written by":"James Gallagher","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/careerkarma.com\/blog\/java-switch-statement\/#article","isPartOf":{"@id":"https:\/\/careerkarma.com\/blog\/java-switch-statement\/"},"author":{"name":"James Gallagher","@id":"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/e79364792443fbff794a144c67ec8e94"},"headline":"Switch Statement Java: How to Use It","datePublished":"2020-03-18T21:58:32+00:00","dateModified":"2023-12-01T10:33:10+00:00","mainEntityOfPage":{"@id":"https:\/\/careerkarma.com\/blog\/java-switch-statement\/"},"wordCount":1063,"commentCount":0,"image":{"@id":"https:\/\/careerkarma.com\/blog\/java-switch-statement\/#primaryimage"},"thumbnailUrl":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/03\/adult-apple-device-business-code-340152.jpg","articleSection":["Java"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/careerkarma.com\/blog\/java-switch-statement\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/careerkarma.com\/blog\/java-switch-statement\/","url":"https:\/\/careerkarma.com\/blog\/java-switch-statement\/","name":"Switch Statement Java: How to Use It | Career Karma","isPartOf":{"@id":"https:\/\/careerkarma.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/careerkarma.com\/blog\/java-switch-statement\/#primaryimage"},"image":{"@id":"https:\/\/careerkarma.com\/blog\/java-switch-statement\/#primaryimage"},"thumbnailUrl":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/03\/adult-apple-device-business-code-340152.jpg","datePublished":"2020-03-18T21:58:32+00:00","dateModified":"2023-12-01T10:33:10+00:00","author":{"@id":"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/e79364792443fbff794a144c67ec8e94"},"description":"The switch statement is used in Java to execute code when a condition evaluates to true. Learn how to use the switch statement in this article.","breadcrumb":{"@id":"https:\/\/careerkarma.com\/blog\/java-switch-statement\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/careerkarma.com\/blog\/java-switch-statement\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/careerkarma.com\/blog\/java-switch-statement\/#primaryimage","url":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/03\/adult-apple-device-business-code-340152.jpg","contentUrl":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/03\/adult-apple-device-business-code-340152.jpg","width":1000,"height":563},{"@type":"BreadcrumbList","@id":"https:\/\/careerkarma.com\/blog\/java-switch-statement\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Blog","item":"https:\/\/careerkarma.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Java","item":"https:\/\/careerkarma.com\/blog\/java\/"},{"@type":"ListItem","position":3,"name":"Switch Statement Java: How to Use It"}]},{"@type":"WebSite","@id":"https:\/\/careerkarma.com\/blog\/#website","url":"https:\/\/careerkarma.com\/blog\/","name":"Career Karma","description":"Latest Coding Bootcamp News &amp; Career Hacks from Industry Insiders","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/careerkarma.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/e79364792443fbff794a144c67ec8e94","name":"James Gallagher","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/01\/james-gallagher-150x150.jpg","contentUrl":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/01\/james-gallagher-150x150.jpg","caption":"James Gallagher"},"description":"James Gallagher is a self-taught programmer and the technical content manager at Career Karma. He has experience in range of programming languages and extensive expertise in Python, HTML, CSS, and JavaScript. James has written hundreds of programming tutorials, and he frequently contributes to publications like Codecademy, Treehouse, Repl.it, Afrotech, and others.","url":"https:\/\/careerkarma.com\/blog\/author\/jamesgallagher\/"}]}},"_links":{"self":[{"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/posts\/13476","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/users\/240"}],"replies":[{"embeddable":true,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/comments?post=13476"}],"version-history":[{"count":0,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/posts\/13476\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/media\/12814"}],"wp:attachment":[{"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/media?parent=13476"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/categories?post=13476"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/tags?post=13476"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}