{"id":13470,"date":"2020-12-20T09:14:43","date_gmt":"2020-12-20T17:14:43","guid":{"rendered":"https:\/\/careerkarma.com\/blog\/?p=13470"},"modified":"2023-12-01T04:06:16","modified_gmt":"2023-12-01T12:06:16","slug":"java-ternary-operator","status":"publish","type":"post","link":"https:\/\/careerkarma.com\/blog\/java-ternary-operator\/","title":{"rendered":"Java Ternary Operator: A Step-By-Step Guide"},"content":{"rendered":"\n<p><em>The Java ternary operator lets you write an if statement on one line of code. A ternary operator can either evaluate to true or false. It returns a specified value depending on whether the statement evaluates to true or false.<\/em><\/p>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<p>We use <a href=\"https:\/\/careerkarma.com\/blog\/if-else-java\/\">Java <em>if&#8230;else<\/em> statements<\/a> to control the flow of a program. An <em>if<\/em> statement will evaluate whether an expression is true or false. This statement executes a specific block of code if the expression is equal to <em>true<\/em>.<\/p>\n\n\n\n<p>However, <em>if&#8230;else<\/em> statements span multiple lines. If you\u2019re evaluating a basic expression, your syntax can become unnecessarily wordy. That\u2019s where the ternary operator comes in. The Java ternary operator is used to replace simple <em>if&#8230;else<\/em> statements to make your code easier to read.<\/p>\n\n\n\n<p>This tutorial will discuss how to use the Java ternary operator. We&#8217;ll walk through an example so you can learn how to use this operator. Let\u2019s get started!<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Java Ternary Operator<\/h2>\n\n\n\n<p>The Java ternary operator lets you write concise <em>if&#8230;else <\/em>statements. Ternary statements get their name because they take three conditions. A ternary operator evaluates whether a statement is true or false and returns a specified value depending on the result of the operator.<\/p>\n\n\n\n<p>Here is the syntax for a ternary operator in Java:\n\n<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>variable = (expression) ? expressionIsTrue : expressionIsFalse;<\/pre><\/div>\n\n\n\n<p>The origin of the name &#8220;ternary&#8221; refers to how a ternary operator has three parts. Our statement takes in three operands:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>expression<\/strong> is the expression the operator should evaluate<\/li><li><strong>expressionIsTrue<\/strong> is the value assigned to <em>variable<\/em> if the expression is true<\/li><li><strong>expressionIsFalse<\/strong> is the value assigned to <em>variable <\/em>if the expression is false<\/li><\/ul>\n\n\n\n<p>You do not need to assign the contents of the ternary operator to a variable. For instance, you could write a ternary operator in a System.out.println() statement. This will let you see the result of your ternary operator in the Java console.<\/p>\n\n\n\n<p>Unlike an &#8220;if&#8221; statement, the ternary operator does not accept an &#8220;else&#8221; keyword. The ternary statement uses the colon (:) to represent an &#8220;else&#8221; condition.<\/p>\n\n\n\n<p>Let&#8217;s use an example to show this operator in action.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Ternary Operator Java Example<\/h2>\n\n\n\n<p>Suppose that we are building a shopping website. We only want people to be allowed to buy products if they are aged 16 or over.<\/p>\n\n\n\n<p>To verify the age of our customers, we could use a ternary operator. This is more efficient than using an &#8220;if&#8221; statement because a user can only be under 16 or aged 16 and over. Here is an example program that would accomplish the task of verifying the age of a user:\n<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>public class EvaluateAge {\n\tpublic static void main(String[] args) {\n\t\tint age = 22;\n\n\t\tString result = (age &gt;= 16) ? &quot;This user is over 16.&quot; : &quot;This user is under 16.&quot;\n\t\tSystem.out.println(result);\n\t}\n}\n<\/pre><\/div>\n\n\n\n<p>Our code evaluates our ternary. Our condition is true so our code returns:\n\n<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>This user is over 16.<\/pre><\/div>\n\n\n\n<p>First, we define a class called EvaluateAge. Then, we declare a <a href=\"https:\/\/careerkarma.com\/blog\/java-variables\/\">Java variable<\/a> called <em>age. <\/em>This variable stores the value of our customer\u2019s age. <em>age<\/em> is assigned the value 22.\n\n<\/p>\n\n\n\n<p>We declare a variable called \u201c<em>result<\/em>\u201d whose value is equal to the result of our ternary operator. The ternary operator evaluates whether the user\u2019s \u201c<em>age<\/em>\u201d is equal to or greater than 16 (\u201c<em>age &gt;= 16<\/em>\u201d).\n\n<\/p>\n\n\n\n<p>If the expression evaluates to <em>true<\/em>, the operator returns \u201cThis user is over 16.\u201d. Otherwise, the operator returns <em>This user is under 16<\/em>. On the final line of our code, we print out the message returned by the <em>result<\/em> variable.<\/p>\n\n\n\n<p>If our user\u2019s age was equal to 15, our code would return the following Java string result:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>This user is under 16.<\/pre><\/div>\n\n\n\n<p>This is because our ternary evaluates to false if the user&#8217;s age is not equal to or greater than 16. We have successfully built a system to check whether a user is old enough to use our services.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">When to Use Ternary Java Operators<\/h2>\n\n\n\n<p>Termaru operators should be used if you have a simple \u201c<em>if<\/em>\u201d statement that you want to appear more concise in your code. The ternary operator makes your code more readable.\n\n<\/p>\n\n\n\n<p>In our example above, we evaluated one expression. If we wrote out the code to evaluate our user\u2019s age as a full \u201c<em>if<\/em>\u201d statement, we would have written:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>if (age &gt;= 16) {\n\tString result = &quot;This user is over 16.&quot;\n} else {\n\tString result = &quot;This user is under 16.&quot;\n}\n\n<\/pre><\/div>\n\n\n\n<p>This <em>if<\/em> statement is simple, but it spans across five lines. By using a ternary statement, we reduced our <em>if<\/em> statement down to a single line.&nbsp;\n\n<\/p>\n\n\n\n<p>Overall, you should only use ternary statements when the resulting statement is short. Otherwise, write a normal <em>if<\/em> statement. The purpose of a ternary operator is to make your code more concise and readable. Moving a complex if statement into a ternary operator goes against that goal.<\/p>\n\n\n\n<p>Both the Java ternary and if statement conditional operators evaluate Boolean expressions. Boolean expressions are those where the only output can be true or false. To learn more about Java Booleans, read our complete guide to <a href=\"https:\/\/careerkarma.com\/blog\/java-boolean\/\">Java Booleans<\/a>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Conclusion<\/h2>\n\n\n\n<p>The ternary operator is a feature in Java that allows you to write more concise <em>if<\/em> statements to control the flow of your code. These operators are referred to as <em>ternary<\/em> because they accept three operands.\n\n<\/p>\n\n\n\n<p>In this tutorial, we covered the basics of Java ternary operators. We also explored how ternary operators compare with Java <em>if<\/em> statements, along with examples of each in action.&nbsp;<\/p>\n\n\n\n<p>Do you want to learn more about coding in Java? Check out our complete <a href=\"https:\/\/careerkarma.com\/blog\/how-to-learn-java\/\">How to Learn Java guide<\/a>. You will find a list of top online courses as well as expert advice on learning the Java programming language.<\/p>\n","protected":false},"excerpt":{"rendered":"The Java ternary operator lets you write an if statement on one line of code. A ternary operator can either evaluate to true or false. It returns a specified value depending on whether the statement evaluates to true or false. We use Java if...else statements to control the flow of a program. An if statement&hellip;","protected":false},"author":240,"featured_media":13471,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[17289],"tags":[],"class_list":{"0":"post-13470","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":null,"is_sponser_post":"","is_guest_post":""},"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v27.4 (Yoast SEO v27.4) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Java Ternary Operator: A Step-By-Step Guide | Career Karma<\/title>\n<meta name=\"description\" content=\"Ternary operators are a concise alternative to simple if...else statements in Java. Learn how to use ternary operators 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-ternary-operator\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Java Ternary Operator: A Step-By-Step Guide\" \/>\n<meta property=\"og:description\" content=\"Ternary operators are a concise alternative to simple if...else statements in Java. Learn how to use ternary operators in this article.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/careerkarma.com\/blog\/java-ternary-operator\/\" \/>\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-12-20T17:14:43+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-12-01T12:06:16+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/03\/people-sitting-beside-brown-wooden-desk-near-flat-screen-tv-1181355.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1000\" \/>\n\t<meta property=\"og:image:height\" content=\"668\" \/>\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-ternary-operator\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/java-ternary-operator\\\/\"},\"author\":{\"name\":\"James Gallagher\",\"@id\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/#\\\/schema\\\/person\\\/e79364792443fbff794a144c67ec8e94\"},\"headline\":\"Java Ternary Operator: A Step-By-Step Guide\",\"datePublished\":\"2020-12-20T17:14:43+00:00\",\"dateModified\":\"2023-12-01T12:06:16+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/java-ternary-operator\\\/\"},\"wordCount\":883,\"commentCount\":0,\"image\":{\"@id\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/java-ternary-operator\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/wp-content\\\/uploads\\\/2020\\\/03\\\/people-sitting-beside-brown-wooden-desk-near-flat-screen-tv-1181355.jpg\",\"articleSection\":[\"Java\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/careerkarma.com\\\/blog\\\/java-ternary-operator\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/java-ternary-operator\\\/\",\"url\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/java-ternary-operator\\\/\",\"name\":\"Java Ternary Operator: A Step-By-Step Guide | Career Karma\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/java-ternary-operator\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/java-ternary-operator\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/wp-content\\\/uploads\\\/2020\\\/03\\\/people-sitting-beside-brown-wooden-desk-near-flat-screen-tv-1181355.jpg\",\"datePublished\":\"2020-12-20T17:14:43+00:00\",\"dateModified\":\"2023-12-01T12:06:16+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/#\\\/schema\\\/person\\\/e79364792443fbff794a144c67ec8e94\"},\"description\":\"Ternary operators are a concise alternative to simple if...else statements in Java. Learn how to use ternary operators in this article.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/java-ternary-operator\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/careerkarma.com\\\/blog\\\/java-ternary-operator\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/java-ternary-operator\\\/#primaryimage\",\"url\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/wp-content\\\/uploads\\\/2020\\\/03\\\/people-sitting-beside-brown-wooden-desk-near-flat-screen-tv-1181355.jpg\",\"contentUrl\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/wp-content\\\/uploads\\\/2020\\\/03\\\/people-sitting-beside-brown-wooden-desk-near-flat-screen-tv-1181355.jpg\",\"width\":1000,\"height\":668},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/java-ternary-operator\\\/#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\":\"Java Ternary Operator: A Step-By-Step Guide\"}]},{\"@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\\\/wp-content\\\/uploads\\\/2020\\\/01\\\/james-gallagher-150x150.jpg\",\"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":"Java Ternary Operator: A Step-By-Step Guide | Career Karma","description":"Ternary operators are a concise alternative to simple if...else statements in Java. Learn how to use ternary operators 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-ternary-operator\/","og_locale":"en_US","og_type":"article","og_title":"Java Ternary Operator: A Step-By-Step Guide","og_description":"Ternary operators are a concise alternative to simple if...else statements in Java. Learn how to use ternary operators in this article.","og_url":"https:\/\/careerkarma.com\/blog\/java-ternary-operator\/","og_site_name":"Career Karma","article_publisher":"http:\/\/facebook.com\/careerkarmaapp","article_published_time":"2020-12-20T17:14:43+00:00","article_modified_time":"2023-12-01T12:06:16+00:00","og_image":[{"width":1000,"height":668,"url":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/03\/people-sitting-beside-brown-wooden-desk-near-flat-screen-tv-1181355.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-ternary-operator\/#article","isPartOf":{"@id":"https:\/\/careerkarma.com\/blog\/java-ternary-operator\/"},"author":{"name":"James Gallagher","@id":"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/e79364792443fbff794a144c67ec8e94"},"headline":"Java Ternary Operator: A Step-By-Step Guide","datePublished":"2020-12-20T17:14:43+00:00","dateModified":"2023-12-01T12:06:16+00:00","mainEntityOfPage":{"@id":"https:\/\/careerkarma.com\/blog\/java-ternary-operator\/"},"wordCount":883,"commentCount":0,"image":{"@id":"https:\/\/careerkarma.com\/blog\/java-ternary-operator\/#primaryimage"},"thumbnailUrl":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/03\/people-sitting-beside-brown-wooden-desk-near-flat-screen-tv-1181355.jpg","articleSection":["Java"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/careerkarma.com\/blog\/java-ternary-operator\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/careerkarma.com\/blog\/java-ternary-operator\/","url":"https:\/\/careerkarma.com\/blog\/java-ternary-operator\/","name":"Java Ternary Operator: A Step-By-Step Guide | Career Karma","isPartOf":{"@id":"https:\/\/careerkarma.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/careerkarma.com\/blog\/java-ternary-operator\/#primaryimage"},"image":{"@id":"https:\/\/careerkarma.com\/blog\/java-ternary-operator\/#primaryimage"},"thumbnailUrl":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/03\/people-sitting-beside-brown-wooden-desk-near-flat-screen-tv-1181355.jpg","datePublished":"2020-12-20T17:14:43+00:00","dateModified":"2023-12-01T12:06:16+00:00","author":{"@id":"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/e79364792443fbff794a144c67ec8e94"},"description":"Ternary operators are a concise alternative to simple if...else statements in Java. Learn how to use ternary operators in this article.","breadcrumb":{"@id":"https:\/\/careerkarma.com\/blog\/java-ternary-operator\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/careerkarma.com\/blog\/java-ternary-operator\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/careerkarma.com\/blog\/java-ternary-operator\/#primaryimage","url":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/03\/people-sitting-beside-brown-wooden-desk-near-flat-screen-tv-1181355.jpg","contentUrl":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/03\/people-sitting-beside-brown-wooden-desk-near-flat-screen-tv-1181355.jpg","width":1000,"height":668},{"@type":"BreadcrumbList","@id":"https:\/\/careerkarma.com\/blog\/java-ternary-operator\/#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":"Java Ternary Operator: A Step-By-Step Guide"}]},{"@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\/wp-content\/uploads\/2020\/01\/james-gallagher-150x150.jpg","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\/13470","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=13470"}],"version-history":[{"count":0,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/posts\/13470\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/media\/13471"}],"wp:attachment":[{"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/media?parent=13470"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/categories?post=13470"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/tags?post=13470"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}