{"id":13643,"date":"2020-11-26T14:43:52","date_gmt":"2020-11-26T22:43:52","guid":{"rendered":"https:\/\/careerkarma.com\/blog\/?p=13643"},"modified":"2023-12-01T04:05:03","modified_gmt":"2023-12-01T12:05:03","slug":"java-sort-arraylist","status":"publish","type":"post","link":"https:\/\/careerkarma.com\/blog\/java-sort-arraylist\/","title":{"rendered":"Learn to Sort ArrayList in Java"},"content":{"rendered":"\n<p><em>The Collections.sort() method sorts a Java ArrayList in ascending order. Collections.reverse() reverses the order of a Java ArrayList. You need to import the Java Collections package to use these methods.<\/em><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">How to Sort an ArrayList in Java<\/h2>\n\n\n\n<p>You may encounter a situation where you want to sort a Java ArrayList in ascending or descending order. For instance, you may have a list of student names that you want to sort in alphabetical order.<\/p>\n\n\n\n<p>That\u2019s where the <em>Collections.sort()<\/em> and <em>Collections.reverse()<\/em> methods come in.<\/p>\n\n\n\n<p>The <em>Collections.sort()<\/em> method is used to sort the elements in an ArrayList in Java. <em>Collections.reverse()<\/em> is used to sort the elements in an ArrayList, but in reverse order.<\/p>\n\n\n\n<p>Using examples, this article will discuss sorting an ArrayList in Java. We\u2019ll explore the basics of ArrayLists and the syntax for both the <em>sort()<\/em> and <em>reverse()<\/em> methods.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Java ArrayList<\/h2>\n\n\n\n<p>The <a href=\"https:\/\/careerkarma.com\/blog\/arraylist-java\/\">Java ArrayList class<\/a> allows you to create resizable arrays in Java. ArrayList is an implementation of the List interface, which is used to create lists in Java. This means that the ArrayList class can access a number of List methods used to manipulate and retrieve its data.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Java Sort ArrayList: sort() Method<\/h2>\n\n\n\n<p>The Java Collections package includes a number of methods for manipulating the contents of collections. In Java, an ArrayList is a class that is also a type of collection, so we can use the Collections package with an ArrayList.&nbsp;<\/p>\n\n\n\n<p>The Collections package includes a method called <em>sort()<\/em>. This method is used to sort a collection in ascending order.&nbsp;<\/p>\n\n\n\n<p>Before we can use the <em>sort()<\/em> method, though, we need to import the Collections package. We can do so using this code:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>import java.util.Collections;<\/pre><\/div>\n\n\n\n<p>Now that we\u2019ve imported the Collections package, we can use <em>sort()<\/em>. Here is the syntax for the <em>sort()<\/em> method:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>Collections.sort(listName);<\/pre><\/div>\n\n\n\n<p><em>sort()<\/em> accepts one parameter: the name of the list you want to sort. This method automatically sorts lists in ascending order.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Java ArrayList Sort: sort() Method Example<\/h3>\n\n\n\n<p>Suppose we have a list of student names from an elementary school class, and we want to sort those names in alphabetical order. Here\u2019s a Java program that will sort our unsorted list:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>import java.util.ArrayList;\nimport java.util.Collections;\n\nclass Main {\n\tpublic static void main(String[] args) {\n\t\tArrayList&lt;String&gt; students = new ArrayList&lt;&gt;();\n\n\t\tstudents.add(&quot;Lindsay&quot;);\n\t\tstudents.add(&quot;Peter&quot;);\n\t\tstudents.add(&quot;Lucas&quot;);\n\t\tstudents.add(&quot;Athena&quot;);\n\n\t\tSystem.out.println(&quot;Student list: &quot; + students);\n\n\t\tCollections.sort(students);\n\t\tSystem.out.println(&quot;Sorted student list: &quot; + students);\n\t}\n}<\/pre><\/div>\n\n\n\n<p>Our code returns: <\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>Student list: [Peter, Lindsay, Lucas, Athena]\nSorted student list: [Athena, Lindsay, Lucas, Peter]<\/pre><\/div>\n\n\n\n<p>Let\u2019s break down our code. First, we import the ArrayList and Collections packages that we use throughout our code. We then declare a class, called Main, that stores the code for our main program.<\/p>\n\n\n\n<p>In our main program, we execute the following steps:<\/p>\n\n\n\n<ol class=\"wp-block-list\"><li>We declare a <a href=\"https:\/\/careerkarma.com\/blog\/java-variables\/\">Java variable<\/a> called students.<\/li><li>Next, we add the student names to the ArrayList.<\/li><li>We print the unordered list of student names, preceded by the message <em>Student list:, <\/em>to the console.<\/li><li><em>Collections.sort()<\/em> is performs a natural ordering operation that sorts the list. <\/li><li>We print the message <em>Sorted student list:<\/em> to the console, followed by the newly-sorted list of student names.<\/li><\/ol>\n\n\n\n<p><em>Collections.sort()<\/em> changes the order of an existing list. In the above example, when we executed the <em>Collections.sort()<\/em> method, the method changed the order of our existing list of student names. It did not create a new, sorted list.&nbsp;<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Sort ArrayList Java: reverse() Method<\/h2>\n\n\n\n<p>The <em>Collections.reverse()<\/em> method sorts an ArrayList in reverse <em>order. reverse()<\/em> accepts one parameter: the list whose order you want to reverse.<\/p>\n\n\n\n<p>Here is the syntax for the reverse method:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>Collections.reverse(list)<\/pre><\/div>\n\n\n\n<p>&#8220;list&#8221; refers to the ArrayList whose order you want to reverse.<\/p>\n\n\n\n<p>Because the <em>reverse()<\/em> method reverses the order of items in an ArrayList, we first need to sort the list in ascending order. Then, we can use <em>reverse()<\/em> to reverse the order of its items. Using the <em>Collections.sort()<\/em> and <em>reverse()<\/em> methods together allows you to sort a list in descending order.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Sort ArrayList Java: reverse() Method Example<\/h3>\n\n\n\n<p>Suppose we wanted our list of student names from earlier to be sorted in descending order. We could accomplish this task using the following code:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>import java.util.ArrayList;\nimport java.util.Collections;\n\nclass Main {\n\tpublic static void main(String[] args) {\n\t\tArrayList&lt;String&gt; students = new ArrayList&lt;&gt;();\n\n\t\tstudents.add(&quot;Lindsay&quot;);\n\t\tstudents.add(&quot;Peter&quot;);\n\t\tstudents.add(&quot;Lucas&quot;);\n\t\tstudents.add(&quot;Athena&quot;);\n\n\t\tSystem.out.println(&quot;Student list: &quot; + students);\n\n\t\tCollections.sort(students);\n\t\tCollections.reverse(students);\n\t\tSystem.out.println(&quot;Sorted student list: &quot; + students);\n\t}\n}<\/pre><\/div>\n\n\n\n<p>Our code returns:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>Student list: [Lindsay, Peter, Lucas, Athena]\nSorted student list: [Peter, Lucas, Lindsay, Athena]<\/pre><\/div>\n\n\n\n<p>First we sort our list in alphabetical order. We reverse the order of the items in the list to see them in reverse alphabetical order. After we sort the students list using <em>Collections.sort()<\/em>, we reverse the order of the items in the list using <em>Collections.reverse()<\/em>. <\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Conclusion<\/h2>\n\n\n\n<p>The Java <em>Collections.sort()<\/em> method sort an ArrayList in ascending order. <em>Collections.reverse()<\/em> method reverses the order of items in an ArrayList. When used together, <em>sort()<\/em> and <em>reverse()<\/em> can sort the items in an ArrayList in descending order.<\/p>\n\n\n\n<p>There\u2019s still much more to learn about using ArrayLists in Java. To learn more, you may want to view the following tutorials:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><a href=\"https:\/\/careerkarma.com\/blog\/java-arraylist-to-array\/\">ArrayList to Array conversion<\/a><\/li><li><a href=\"https:\/\/careerkarma.com\/blog\/java-initialize-arraylist\/\">How to initialize an ArrayList<\/a><\/li><li><a href=\"https:\/\/careerkarma.com\/blog\/java-sort-arraylist\/\">How to sort an ArrayList<\/a><\/li><\/ul>\n\n\n\n<p>To learn more about coding in Java, read our <a href=\"https:\/\/careerkarma.com\/blog\/how-to-learn-java\/\">How to Learn Java guide<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"The Collections.sort() method sorts a Java ArrayList in ascending order. Collections.reverse() reverses the order of a Java ArrayList. You need to import the Java Collections package to use these methods. How to Sort an ArrayList in Java You may encounter a situation where you want to sort a Java ArrayList in ascending or descending order.&hellip;","protected":false},"author":240,"featured_media":13644,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[17289],"tags":[],"class_list":{"0":"post-13643","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.0 (Yoast SEO v27.0) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Learn to Sort ArrayList in Java: A Step-by-Step Guide | Career Karma<\/title>\n<meta name=\"description\" content=\"Java developers use the Collections.sort method to sort an ArrayList. On Career Karma, learn how to use the sort method.\" \/>\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-sort-arraylist\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Learn to Sort ArrayList in Java\" \/>\n<meta property=\"og:description\" content=\"Java developers use the Collections.sort method to sort an ArrayList. On Career Karma, learn how to use the sort method.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/careerkarma.com\/blog\/java-sort-arraylist\/\" \/>\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-11-26T22:43:52+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-12-01T12:05:03+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/03\/photography-of-person-typing-1181675.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1020\" \/>\n\t<meta property=\"og:image:height\" content=\"681\" \/>\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-sort-arraylist\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/java-sort-arraylist\/\"},\"author\":{\"name\":\"James Gallagher\",\"@id\":\"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/e79364792443fbff794a144c67ec8e94\"},\"headline\":\"Learn to Sort ArrayList in Java\",\"datePublished\":\"2020-11-26T22:43:52+00:00\",\"dateModified\":\"2023-12-01T12:05:03+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/java-sort-arraylist\/\"},\"wordCount\":788,\"commentCount\":0,\"image\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/java-sort-arraylist\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/03\/photography-of-person-typing-1181675.jpg\",\"articleSection\":[\"Java\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/careerkarma.com\/blog\/java-sort-arraylist\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/careerkarma.com\/blog\/java-sort-arraylist\/\",\"url\":\"https:\/\/careerkarma.com\/blog\/java-sort-arraylist\/\",\"name\":\"Learn to Sort ArrayList in Java: A Step-by-Step Guide | Career Karma\",\"isPartOf\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/java-sort-arraylist\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/java-sort-arraylist\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/03\/photography-of-person-typing-1181675.jpg\",\"datePublished\":\"2020-11-26T22:43:52+00:00\",\"dateModified\":\"2023-12-01T12:05:03+00:00\",\"author\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/e79364792443fbff794a144c67ec8e94\"},\"description\":\"Java developers use the Collections.sort method to sort an ArrayList. On Career Karma, learn how to use the sort method.\",\"breadcrumb\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/java-sort-arraylist\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/careerkarma.com\/blog\/java-sort-arraylist\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/careerkarma.com\/blog\/java-sort-arraylist\/#primaryimage\",\"url\":\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/03\/photography-of-person-typing-1181675.jpg\",\"contentUrl\":\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/03\/photography-of-person-typing-1181675.jpg\",\"width\":1020,\"height\":681},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/careerkarma.com\/blog\/java-sort-arraylist\/#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\":\"Learn to Sort ArrayList 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":"Learn to Sort ArrayList in Java: A Step-by-Step Guide | Career Karma","description":"Java developers use the Collections.sort method to sort an ArrayList. On Career Karma, learn how to use the sort method.","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-sort-arraylist\/","og_locale":"en_US","og_type":"article","og_title":"Learn to Sort ArrayList in Java","og_description":"Java developers use the Collections.sort method to sort an ArrayList. On Career Karma, learn how to use the sort method.","og_url":"https:\/\/careerkarma.com\/blog\/java-sort-arraylist\/","og_site_name":"Career Karma","article_publisher":"http:\/\/facebook.com\/careerkarmaapp","article_published_time":"2020-11-26T22:43:52+00:00","article_modified_time":"2023-12-01T12:05:03+00:00","og_image":[{"width":1020,"height":681,"url":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/03\/photography-of-person-typing-1181675.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-sort-arraylist\/#article","isPartOf":{"@id":"https:\/\/careerkarma.com\/blog\/java-sort-arraylist\/"},"author":{"name":"James Gallagher","@id":"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/e79364792443fbff794a144c67ec8e94"},"headline":"Learn to Sort ArrayList in Java","datePublished":"2020-11-26T22:43:52+00:00","dateModified":"2023-12-01T12:05:03+00:00","mainEntityOfPage":{"@id":"https:\/\/careerkarma.com\/blog\/java-sort-arraylist\/"},"wordCount":788,"commentCount":0,"image":{"@id":"https:\/\/careerkarma.com\/blog\/java-sort-arraylist\/#primaryimage"},"thumbnailUrl":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/03\/photography-of-person-typing-1181675.jpg","articleSection":["Java"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/careerkarma.com\/blog\/java-sort-arraylist\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/careerkarma.com\/blog\/java-sort-arraylist\/","url":"https:\/\/careerkarma.com\/blog\/java-sort-arraylist\/","name":"Learn to Sort ArrayList in Java: A Step-by-Step Guide | Career Karma","isPartOf":{"@id":"https:\/\/careerkarma.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/careerkarma.com\/blog\/java-sort-arraylist\/#primaryimage"},"image":{"@id":"https:\/\/careerkarma.com\/blog\/java-sort-arraylist\/#primaryimage"},"thumbnailUrl":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/03\/photography-of-person-typing-1181675.jpg","datePublished":"2020-11-26T22:43:52+00:00","dateModified":"2023-12-01T12:05:03+00:00","author":{"@id":"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/e79364792443fbff794a144c67ec8e94"},"description":"Java developers use the Collections.sort method to sort an ArrayList. On Career Karma, learn how to use the sort method.","breadcrumb":{"@id":"https:\/\/careerkarma.com\/blog\/java-sort-arraylist\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/careerkarma.com\/blog\/java-sort-arraylist\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/careerkarma.com\/blog\/java-sort-arraylist\/#primaryimage","url":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/03\/photography-of-person-typing-1181675.jpg","contentUrl":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/03\/photography-of-person-typing-1181675.jpg","width":1020,"height":681},{"@type":"BreadcrumbList","@id":"https:\/\/careerkarma.com\/blog\/java-sort-arraylist\/#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":"Learn to Sort ArrayList 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\/13643","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=13643"}],"version-history":[{"count":0,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/posts\/13643\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/media\/13644"}],"wp:attachment":[{"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/media?parent=13643"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/categories?post=13643"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/tags?post=13643"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}