{"id":13433,"date":"2020-03-17T18:09:59","date_gmt":"2020-03-18T01:09:59","guid":{"rendered":"https:\/\/careerkarma.com\/blog\/?p=13433"},"modified":"2023-12-01T02:32:53","modified_gmt":"2023-12-01T10:32:53","slug":"java-if-else","status":"publish","type":"post","link":"https:\/\/careerkarma.com\/blog\/java-if-else\/","title":{"rendered":"How to Use If&#8230;Else Statements in Java"},"content":{"rendered":"\n<p>When you\u2019re programming, it\u2019s common to write code that should only be executed when a certain condition is met.<br><\/p>\n\n\n\n<p>For instance, you may want an order to be placed on your e-commerce site only if a user has submitted their address. Or you may operate a coffee store and want to give a user a discount on their coffee if they have ordered more than five coffees in the last week.<br><\/p>\n\n\n\n<p>In programming, we use conditional statements for this purpose. Conditional statements execute a specific block of code based on whether a condition evaluates to true or false. In Java, the <code>if...else<\/code> statement is a control flow statement that allows you to execute a block of code only if a certain condition is met.<br><\/p>\n\n\n\n<p>This tutorial will explore how to use the <code>if...else<\/code> statement in Java, and explore a few examples of the <code>if...else<\/code> statement being used in a Java program.<br><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Java If Statement<\/h2>\n\n\n\n<p>The most basic conditional statement is the <code>if<\/code> statement. <code>if<\/code> statements evaluate whether a statement is equal to true or false, and will only execute if the statement is equal to true. If the statement evaluates to false, the program will skip over the <code>if<\/code> statement and continue running the rest of the program.<br><\/p>\n\n\n\n<p>In Java, <code>if<\/code> statements are written like this:<br><\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>if (condition_is_met) {\n\t\/\/ Execute code\n}\n<\/pre><\/div>\n\n\n\n<p>Let\u2019s break it down. Our <code>if<\/code> statement accepts a <strong>condition<\/strong>, which is the boolean expression that returns a true or false value. Then, the code that should be executed if the condition evaluates to true is enclosed within curly brackets ({}).<br><\/p>\n\n\n\n<p>The code within an <code>if<\/code> statement is indented. Additionally, the <code>if<\/code> statement does not require a semicolon at the end, unlike other lines of code in Java.<br><\/p>\n\n\n\n<p>Let\u2019s walk through an example to illustrate how this works. Suppose we are running a coffee shop and we want to offer a 10% discount to any customer who has purchased more than five coffees in the last week. We could use the following code to check if a customer is eligible for the offer:<br><\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>public class CheckDiscount {\n\tpublic static void main(String[] args) {\nint coffees_ordered_in_last_week = 4;\nint discount = 0;\nif (coffees_ordered_in_last_week &gt; 5) {\n\tdiscount = 10;\n}\nSystem.out.println(\"This customer is eligible for a \" + discount + \"% discount.\");\n\t}\n}\n<\/pre><\/div>\n\n\n\n<p>When we execute our code, the following response is returned:<br><\/p>\n\n\n\n<p>This customer is eligible for a 0% discount.<br><\/p>\n\n\n\n<p>Let\u2019s break down our code. First, we declare a class called CheckDiscount in which our code for this program is enclosed.<br><\/p>\n\n\n\n<p>Next, we declare a variable called <code>coffees_ordered_in_last_week<\/code> that tracks how many coffees our customer has ordered in the last week. Then we initialize a variable called \u201cdiscount\u201d which keeps track of the discount for which our customer is eligible.<br><\/p>\n\n\n\n<p>On the next line, we use an <code>if<\/code> statement that checks whether <code>coffees_ordered_in_last_week<\/code> is greater than 5. If it is, the customer will be eligible for a 10% discount; if it is not, the program skips over the code in the<code>if<\/code> statement.<br><\/p>\n\n\n\n<p>In this case, our customer has only ordered four coffees in the last week, and so our program does not run the <code>discount = 10<\/code> line of code. At the end of our program, we print out a message to the console stating, <code>This customer is eligible for a [X]% discount.<\/code>, where X is equal to the discount determined by the program.<br><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">If Else Java<\/h2>\n\n\n\n<p>When we use an <code>if<\/code> statement, we only execute code when a condition is true. Often, however, we will want another block of code to run if the condition is false.<br><\/p>\n\n\n\n<p>The <code>else<\/code> statement is written after an <code>if<\/code> statement and has no condition. The <code>else<\/code> statement is optional and will execute only if the condition in the <code>if<\/code> statement evaluates to false.<br><\/p>\n\n\n\n<p>Here\u2019s the syntax for a Java <code>if...else<\/code> statement:<br><\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>if (condition_is_met) {\n\t\/\/ Execute code\n} else {\n\t\/\/ Execute other code\n}\n<\/pre><\/div>\n\n\n\n<p>Let\u2019s use our example from above to illustrate how this works. Suppose we are running a promotion where every customer is eligible for a 5% discount on Saturday. Today is Saturday, and so we want to give each customer a 5% discount. This discount is only available to people who have not ordered more than five coffees in the last week, as people who have ordered more than five coffees are eligible for a 10% discount.<br><\/p>\n\n\n\n<p>We could use the following program to give each customer who has ordered more than five coffees in the last week a 10% discount, and give every other customer a 5% discount:<br><\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>class CheckDiscount {\n\tpublic static void main(String[] args) {\nint coffees_ordered_in_last_week = 4;\nint discount = 0;\nif (coffees_ordered_in_last_week &gt; 5) {\n\tdiscount = 10;\n} else {\n\tdiscount = 5;\n}\nSystem.out.println(\"This customer is eligible for a \" + discount + \"% discount.\");\n\t}\n}\n<\/pre><\/div>\n\n\n\n<p>Our code returns:<br><\/p>\n\n\n\n<p><code>This customer is eligible for a 5% discount.<br><\/code><\/p>\n\n\n\n<p>Our code works in the same way as our first example. However, this time around, we have specified an <code>else<\/code> statement in our code, which will run if the statement <code>coffees_ordered_in_last_week &gt; 5<\/code> evaluates to false. In this case, our customer has not ordered five coffees, so that statement evaluates to false.<br><\/p>\n\n\n\n<p>As a result, our program executes the contents of the <code>else<\/code> block, which sets the value of the <code>discount<\/code> variable to five. So, when our program tells us the discount for which the customer is eligible, 5% is stated as the discount.<br><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">If Else If Java<\/h2>\n\n\n\n<p>You may be writing a program where you want to evaluate multiple statements and execute code depending on which statement (if any) evaluates to true. That\u2019s where the <code>if...else...if<\/code> statement comes in. The <code>if...else...if<\/code> statement checks for one statement, then evaluates it for subsequent statements.<br><\/p>\n\n\n\n<p>Here\u2019s the syntax for a Java <code>if...else...if<\/code> statement:<br><\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>if (condition1_is_met) {\n\t\/\/ Run condition 1 code\n} else if (condition2_is_met) {\n\t\/\/ Run condition 2 code\n} else {\n\t\/\/ Run other code\n}\n<\/pre><\/div>\n\n\n\n<p>The <code>if<\/code> statements are executed from the top downward. When an expression evaluates to true, the code within the corresponding block will execute. If no expression evaluates to true, the code within the <code>else<\/code> statement will run.<br><\/p>\n\n\n\n<p>Suppose we want to offer a 15% discount to everyone who has ordered more than ten coffees in the last week. These customers are often people who order for their friends or their workplaces, and so we want to do as much as possible to retain them.<br><\/p>\n\n\n\n<p>We could use the following code to offer this discount, in addition to our 5% discount on Saturdays and our 10% discount to people who have ordered more than five coffees in the last week:<br><\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>class CheckDiscount {\n\tpublic static void main(String[] args) {\nint coffees_ordered_in_last_week = 4;\nint discount = 0;\nif (coffees_ordered_in_last_week &gt; 5) {\n\tdiscount = 10;\n} else if (coffees_ordered_in_last_weel &gt; 10) {\n\tdiscount = 15;\n} else {\n\tdiscount = 5;\n}\nSystem.out.println(\"This customer is eligible for a \" + discount + \"% discount.\");\n\t}\n}\n<\/pre><\/div>\n\n\n\n<p>When we run our code, the following is returned:<br><\/p>\n\n\n\n<p><code>This customer is eligible for a 5% discount.<br><\/code><\/p>\n\n\n\n<p>Our customer has only ordered four coffees in the last week, and so the contents of our <code>else<\/code> statement are executed. But if our customer had ordered more than five coffees, the value of the <code>discount<\/code> variable would be set to 10; if our customer had ordered more than ten coffees, the value of the <code>discount<\/code> variable would be set to fifteen.<br><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Conclusion<\/h2>\n\n\n\n<p>The <code>if<\/code> statement is used in Java to run a block of code if a certain condition evaluates to true. The <code>if...else<\/code> statement is used with an<code> if <\/code>statement to run code if a condition evaluates to false. In addition, the <code>if...else...if<\/code> statement is used to evaluate multiple conditions.<br><\/p>\n\n\n\n<p>This tutorial discussed, with reference to examples, how to control the flow of your Java programs using <code>if<\/code>,<code> if...else<\/code>, and <code>if...else...if <\/code>statements. You\u2019re now ready to start using these Java conditional statements like an expert!<\/p>\n","protected":false},"excerpt":{"rendered":"When you\u2019re programming, it\u2019s common to write code that should only be executed when a certain condition is met. For instance, you may want an order to be placed on your e-commerce site only if a user has submitted their address. Or you may operate a coffee store and want to give a user a&hellip;","protected":false},"author":240,"featured_media":13436,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[17289],"tags":[],"class_list":{"0":"post-13433","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>How to Use If...Else Statements in Java %<\/title>\n<meta name=\"description\" content=\"The Java if and if...else statements are used to control the flow of programs. Learn how to use the if and if...else statements 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-if-else\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Use If...Else Statements in Java\" \/>\n<meta property=\"og:description\" content=\"The Java if and if...else statements are used to control the flow of programs. Learn how to use the if and if...else statements in this article.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/careerkarma.com\/blog\/java-if-else\/\" \/>\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-18T01:09:59+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-12-01T10:32:53+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/03\/computer-desk-electronics-indoors-374074.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"800\" \/>\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-if-else\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/java-if-else\/\"},\"author\":{\"name\":\"James Gallagher\",\"@id\":\"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/e79364792443fbff794a144c67ec8e94\"},\"headline\":\"How to Use If&#8230;Else Statements in Java\",\"datePublished\":\"2020-03-18T01:09:59+00:00\",\"dateModified\":\"2023-12-01T10:32:53+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/java-if-else\/\"},\"wordCount\":1083,\"commentCount\":0,\"image\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/java-if-else\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/03\/computer-desk-electronics-indoors-374074.jpg\",\"articleSection\":[\"Java\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/careerkarma.com\/blog\/java-if-else\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/careerkarma.com\/blog\/java-if-else\/\",\"url\":\"https:\/\/careerkarma.com\/blog\/java-if-else\/\",\"name\":\"How to Use If...Else Statements in Java %\",\"isPartOf\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/java-if-else\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/java-if-else\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/03\/computer-desk-electronics-indoors-374074.jpg\",\"datePublished\":\"2020-03-18T01:09:59+00:00\",\"dateModified\":\"2023-12-01T10:32:53+00:00\",\"author\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/e79364792443fbff794a144c67ec8e94\"},\"description\":\"The Java if and if...else statements are used to control the flow of programs. Learn how to use the if and if...else statements in this article.\",\"breadcrumb\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/java-if-else\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/careerkarma.com\/blog\/java-if-else\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/careerkarma.com\/blog\/java-if-else\/#primaryimage\",\"url\":\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/03\/computer-desk-electronics-indoors-374074.jpg\",\"contentUrl\":\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/03\/computer-desk-electronics-indoors-374074.jpg\",\"width\":1200,\"height\":800},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/careerkarma.com\/blog\/java-if-else\/#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\":\"How to Use If&#8230;Else Statements in Java\"}]},{\"@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":"How to Use If...Else Statements in Java %","description":"The Java if and if...else statements are used to control the flow of programs. Learn how to use the if and if...else statements 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-if-else\/","og_locale":"en_US","og_type":"article","og_title":"How to Use If...Else Statements in Java","og_description":"The Java if and if...else statements are used to control the flow of programs. Learn how to use the if and if...else statements in this article.","og_url":"https:\/\/careerkarma.com\/blog\/java-if-else\/","og_site_name":"Career Karma","article_publisher":"http:\/\/facebook.com\/careerkarmaapp","article_published_time":"2020-03-18T01:09:59+00:00","article_modified_time":"2023-12-01T10:32:53+00:00","og_image":[{"width":1200,"height":800,"url":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/03\/computer-desk-electronics-indoors-374074.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-if-else\/#article","isPartOf":{"@id":"https:\/\/careerkarma.com\/blog\/java-if-else\/"},"author":{"name":"James Gallagher","@id":"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/e79364792443fbff794a144c67ec8e94"},"headline":"How to Use If&#8230;Else Statements in Java","datePublished":"2020-03-18T01:09:59+00:00","dateModified":"2023-12-01T10:32:53+00:00","mainEntityOfPage":{"@id":"https:\/\/careerkarma.com\/blog\/java-if-else\/"},"wordCount":1083,"commentCount":0,"image":{"@id":"https:\/\/careerkarma.com\/blog\/java-if-else\/#primaryimage"},"thumbnailUrl":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/03\/computer-desk-electronics-indoors-374074.jpg","articleSection":["Java"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/careerkarma.com\/blog\/java-if-else\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/careerkarma.com\/blog\/java-if-else\/","url":"https:\/\/careerkarma.com\/blog\/java-if-else\/","name":"How to Use If...Else Statements in Java %","isPartOf":{"@id":"https:\/\/careerkarma.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/careerkarma.com\/blog\/java-if-else\/#primaryimage"},"image":{"@id":"https:\/\/careerkarma.com\/blog\/java-if-else\/#primaryimage"},"thumbnailUrl":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/03\/computer-desk-electronics-indoors-374074.jpg","datePublished":"2020-03-18T01:09:59+00:00","dateModified":"2023-12-01T10:32:53+00:00","author":{"@id":"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/e79364792443fbff794a144c67ec8e94"},"description":"The Java if and if...else statements are used to control the flow of programs. Learn how to use the if and if...else statements in this article.","breadcrumb":{"@id":"https:\/\/careerkarma.com\/blog\/java-if-else\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/careerkarma.com\/blog\/java-if-else\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/careerkarma.com\/blog\/java-if-else\/#primaryimage","url":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/03\/computer-desk-electronics-indoors-374074.jpg","contentUrl":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/03\/computer-desk-electronics-indoors-374074.jpg","width":1200,"height":800},{"@type":"BreadcrumbList","@id":"https:\/\/careerkarma.com\/blog\/java-if-else\/#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":"How to Use If&#8230;Else Statements in Java"}]},{"@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\/13433","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=13433"}],"version-history":[{"count":0,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/posts\/13433\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/media\/13436"}],"wp:attachment":[{"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/media?parent=13433"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/categories?post=13433"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/tags?post=13433"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}