{"id":13514,"date":"2020-03-18T17:26:59","date_gmt":"2020-03-19T00:26:59","guid":{"rendered":"https:\/\/careerkarma.com\/blog\/?p=13514"},"modified":"2023-12-01T02:33:29","modified_gmt":"2023-12-01T10:33:29","slug":"how-to-use-java-constructors","status":"publish","type":"post","link":"https:\/\/careerkarma.com\/blog\/how-to-use-java-constructors\/","title":{"rendered":"How to Use Java Constructors"},"content":{"rendered":"\n<p>In Java, methods are used to store blocks of code that perform a specific action. When you\u2019re working with methods, you may encounter a concept called <code>constructors<\/code>.<br><\/p>\n\n\n\n<p>Constructors are special methods used to initialize objects in Java. Constructors are called when the object of a class is created, and are used to set initial values for an object.<br><\/p>\n\n\n\n<p>This tutorial will discuss, with examples, the basics of Java constructors and how to use constructors in your code. By the end of reading this tutorial, you\u2019ll be an expert at using Java constructors to initialize objects.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Java Constructors<\/h2>\n\n\n\n<p>Constructors initialize a newly created object before it is used in a program. So, for instance, a constructor called Supplier would create an object with the default attributes of a supplier.<br><\/p>\n\n\n\n<p>Constructors have the same name as their class and do not return any value. Here is an example of a constructor in Java:<br><\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>class Supplier {\n\tSupplier() {\n\t\t\/\/ Code here\n\t}\n}<\/pre><\/div>\n\n\n\n<p>In this example, we have declared a constructor called <code>Supplier<\/code>, which has the same name as our class. In addition, our constructor does not have any return type\u2014such as void\u2014which is what distinguishes it from other types of methods.<br><\/p>\n\n\n\n<p>There are two rules you need to know when you\u2019re declaring a constructor. First, the name of a constructor must match the name of the class in which the constructor is declared exactly. Second, constructors cannot return values.<br><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">How to Create a Java Constructor<\/h2>\n\n\n\n<p>There are two types of Java constructors: no-arg constructors and parameterized constructors. Let\u2019s break down how to create a constructor using both these types.<br><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">No-arg Constructors<\/h3>\n\n\n\n<p>Suppose we are operating a grocery store and we want to create a program that stores details about our main supplier for cheese. This program should include a constructor which stores the supplier\u2019s information, and should also print out those values to the console.<br><\/p>\n\n\n\n<p>Here\u2019s the code we would use to create this program:<br><\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>class MainCheeseSupplier {\n\tprivate String name;\n\tprivate String address;\n\tprivate int discountRate;\n\tprivate String payDate;\n\tprivate MainCheeseSupplier() {\n\t\tname = \"J. Acker Dairy\";\n\t\taddress = \"1600 Johnson Ave. San Francisco 94127\";\n\t\tdiscountRate = 2;\n\t\tpayDate = \"Last day of the month.\";\n\t}\n\tpublic static void main(String[] args) {\n\t\tMainCheeseSupplier jadairy = new MainCheeseSupplier();\n\t\tSystem.out.println(\"Name: \" + jadairy.name);\n\t\tSystem.out.println(\"Address: \" + jadairy.address);\n\t\tSystem.out.println(\"Discount rate: \" + jadairy.discountRate);\n\t\tSystem.out.println(\"Pay date: \" + jadairy.payDate);\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>Name: J. Acker Dairy\nAddress: 1600 Johnson Ave. San Francisco 94127\nDiscount rate: 2\nPay date: Last day of the month.<\/pre><\/div>\n\n\n\n<p>First, we have defined a class called <code>MainCheeseSupplier<\/code> which holds the code for our program. Then we initialized four private variables\u2014<code>name<\/code>, <code>address<\/code>, <code>discountRate<\/code>, and <code>payDate<\/code>\u2014which we use to store information about our main cheese supplier.<br><\/p>\n\n\n\n<p>Once we have declared those variables, we create a constructor called <code>MainCheeseSupplier<\/code> which initializes them with default values. Then, in our main program, we initialize an instance of our constructor by using this code:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>MainCheeseSupplier jadairy = new MainCheeseSupplier();<\/pre><\/div>\n\n\n\n<p>This code assigns the variable <code>jadairy<\/code> a new instance of the <code>MainCheeseSupplier<\/code> object. Then, we print out each value held in jadairy to the console by referencing the <code>jadairy<\/code> variable and the attribute we want to access.<br><\/p>\n\n\n\n<p>This is an example of a <strong>no-arg constructor<\/strong>. Because our constructor does not accept any parameters, we refer to it as no-arg.<br><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Parameterized Constructor<\/h3>\n\n\n\n<p>However, there may be a case where you want to pass arguments through a constructor.&nbsp;<br><\/p>\n\n\n\n<p>Let\u2019s return to the grocery store. Say that we want to define the values of our main cheese supplier details in our main program and assign them to our constructor when the main program has started executing.<br><\/p>\n\n\n\n<p>We may want to do this because we are initializing multiple suppliers with different values, or because we do not want to assign specific values to the constructor.<br><\/p>\n\n\n\n<p>If we pass arguments through a constructor, we call it a parameterized constructor.<br><\/p>\n\n\n\n<p>We could pass a parameter list through a constructor like this:<br><\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>class MainCheeseSupplier {\n\tString name;\n\tString address;\n\tint discountRate;\n\tString payDate;\n\tpublic MainCheeseSupplier(String supplierName, String supplierAddress, int supplierDiscountRate, String supplierPayDate) {\n\t\tname = supplierName;\n\t\taddress = supplierAddress;\n\t\tdiscountRate = supplierDiscountRate;\n\t\tpayDate = supplierPayDate;\n\t}\n\tpublic static void main(String[] args) {\n\t\tMainCheeseSupplier jadairy = new MainCheeseSupplier(\"J. Acker Dairy\", \"1600 Johnson Ave. San Francisco 94127\", 2,  \"Last day of the month.\");\n\t\tSystem.out.println(\"Name: \" + jadairy.name);\n\t\tSystem.out.println(\"Address: \" + jadairy.address);\n\t\tSystem.out.println(\"Discount rate: \" + jadairy.discountRate);\n\t\tSystem.out.pintln(\"Pay date: \" + jadairy.payDate);\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>Name: J. Acker Dairy\nAddress: 1600 Johnson Ave. San Francisco 94127\nDiscount rate: 2\nPay date: Last day of the month.<\/pre><\/div>\n\n\n\n<p>As you can see, the output of our code in this example is the same as it was in our first example. However, there is one big difference in our code: instead of initializing the values of our constructor in the constructor itself, we pass them as parameters when we declare an instance of the constructor.<br><\/p>\n\n\n\n<p>In the above example, the <code>MainCheeseSupplier<\/code> constructor accepts four parameters: <code>supplierName<\/code>, <code>supplierAddress<\/code>, <code>supplierDiscountRate<\/code>, and <code>supplierPayDate<\/code>. When we initialize an instance of the <code>MainCheeseSupplier<\/code> constructor, we pass values through these parameters, which are then read by our constructor. Here\u2019s the code we use to initialize an instance of the constructor:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>MainCheeseSupplier jadairy = new MainCheeseSupplier(\"J. Acker Dairy\", \"1600 Johnson Ave. San Francisco 94127\", 2,  \"Last day of the month.\");<\/pre><\/div>\n\n\n\n<p>Then, we print out the contents of the values we stored in the <code>MainCheeseSupplier<\/code> constructor.<br><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Conclusion<\/h2>\n\n\n\n<p>Java constructors are special methods used to initialize objects. Constructors are called when an object of a class is created and can be used to set initial values for an object\u2019s attributes.<br><\/p>\n\n\n\n<p>This tutorial discussed, with reference to examples, how to create and work with constructors in Java. Now you\u2019re ready to start using Java constructors like an expert!<\/p>\n","protected":false},"excerpt":{"rendered":"In Java, methods are used to store blocks of code that perform a specific action. When you\u2019re working with methods, you may encounter a concept called constructors. Constructors are special methods used to initialize objects in Java. Constructors are called when the object of a class is created, and are used to set initial values&hellip;","protected":false},"author":240,"featured_media":13491,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[17289],"tags":[],"class_list":{"0":"post-13514","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 Java Constructors | Career Karma<\/title>\n<meta name=\"description\" content=\"Constructors are special methods used to initialize objects in Java. Learn how to create and work with Java constructors in your code on Career Karma.\" \/>\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\/how-to-use-java-constructors\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Use Java Constructors\" \/>\n<meta property=\"og:description\" content=\"Constructors are special methods used to initialize objects in Java. Learn how to create and work with Java constructors in your code on Career Karma.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/careerkarma.com\/blog\/how-to-use-java-constructors\/\" \/>\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-19T00:26:59+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-12-01T10:33:29+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/03\/man-using-ballpoint-pen-374820.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1000\" \/>\n\t<meta property=\"og:image:height\" content=\"667\" \/>\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=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/careerkarma.com\/blog\/how-to-use-java-constructors\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/how-to-use-java-constructors\/\"},\"author\":{\"name\":\"James Gallagher\",\"@id\":\"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/e79364792443fbff794a144c67ec8e94\"},\"headline\":\"How to Use Java Constructors\",\"datePublished\":\"2020-03-19T00:26:59+00:00\",\"dateModified\":\"2023-12-01T10:33:29+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/how-to-use-java-constructors\/\"},\"wordCount\":736,\"commentCount\":0,\"image\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/how-to-use-java-constructors\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/03\/man-using-ballpoint-pen-374820.jpg\",\"articleSection\":[\"Java\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/careerkarma.com\/blog\/how-to-use-java-constructors\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/careerkarma.com\/blog\/how-to-use-java-constructors\/\",\"url\":\"https:\/\/careerkarma.com\/blog\/how-to-use-java-constructors\/\",\"name\":\"How to Use Java Constructors | Career Karma\",\"isPartOf\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/how-to-use-java-constructors\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/how-to-use-java-constructors\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/03\/man-using-ballpoint-pen-374820.jpg\",\"datePublished\":\"2020-03-19T00:26:59+00:00\",\"dateModified\":\"2023-12-01T10:33:29+00:00\",\"author\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/e79364792443fbff794a144c67ec8e94\"},\"description\":\"Constructors are special methods used to initialize objects in Java. Learn how to create and work with Java constructors in your code on Career Karma.\",\"breadcrumb\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/how-to-use-java-constructors\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/careerkarma.com\/blog\/how-to-use-java-constructors\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/careerkarma.com\/blog\/how-to-use-java-constructors\/#primaryimage\",\"url\":\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/03\/man-using-ballpoint-pen-374820.jpg\",\"contentUrl\":\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/03\/man-using-ballpoint-pen-374820.jpg\",\"width\":1000,\"height\":667},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/careerkarma.com\/blog\/how-to-use-java-constructors\/#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 Java Constructors\"}]},{\"@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 Java Constructors | Career Karma","description":"Constructors are special methods used to initialize objects in Java. Learn how to create and work with Java constructors in your code on Career Karma.","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\/how-to-use-java-constructors\/","og_locale":"en_US","og_type":"article","og_title":"How to Use Java Constructors","og_description":"Constructors are special methods used to initialize objects in Java. Learn how to create and work with Java constructors in your code on Career Karma.","og_url":"https:\/\/careerkarma.com\/blog\/how-to-use-java-constructors\/","og_site_name":"Career Karma","article_publisher":"http:\/\/facebook.com\/careerkarmaapp","article_published_time":"2020-03-19T00:26:59+00:00","article_modified_time":"2023-12-01T10:33:29+00:00","og_image":[{"width":1000,"height":667,"url":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/03\/man-using-ballpoint-pen-374820.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":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/careerkarma.com\/blog\/how-to-use-java-constructors\/#article","isPartOf":{"@id":"https:\/\/careerkarma.com\/blog\/how-to-use-java-constructors\/"},"author":{"name":"James Gallagher","@id":"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/e79364792443fbff794a144c67ec8e94"},"headline":"How to Use Java Constructors","datePublished":"2020-03-19T00:26:59+00:00","dateModified":"2023-12-01T10:33:29+00:00","mainEntityOfPage":{"@id":"https:\/\/careerkarma.com\/blog\/how-to-use-java-constructors\/"},"wordCount":736,"commentCount":0,"image":{"@id":"https:\/\/careerkarma.com\/blog\/how-to-use-java-constructors\/#primaryimage"},"thumbnailUrl":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/03\/man-using-ballpoint-pen-374820.jpg","articleSection":["Java"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/careerkarma.com\/blog\/how-to-use-java-constructors\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/careerkarma.com\/blog\/how-to-use-java-constructors\/","url":"https:\/\/careerkarma.com\/blog\/how-to-use-java-constructors\/","name":"How to Use Java Constructors | Career Karma","isPartOf":{"@id":"https:\/\/careerkarma.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/careerkarma.com\/blog\/how-to-use-java-constructors\/#primaryimage"},"image":{"@id":"https:\/\/careerkarma.com\/blog\/how-to-use-java-constructors\/#primaryimage"},"thumbnailUrl":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/03\/man-using-ballpoint-pen-374820.jpg","datePublished":"2020-03-19T00:26:59+00:00","dateModified":"2023-12-01T10:33:29+00:00","author":{"@id":"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/e79364792443fbff794a144c67ec8e94"},"description":"Constructors are special methods used to initialize objects in Java. Learn how to create and work with Java constructors in your code on Career Karma.","breadcrumb":{"@id":"https:\/\/careerkarma.com\/blog\/how-to-use-java-constructors\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/careerkarma.com\/blog\/how-to-use-java-constructors\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/careerkarma.com\/blog\/how-to-use-java-constructors\/#primaryimage","url":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/03\/man-using-ballpoint-pen-374820.jpg","contentUrl":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/03\/man-using-ballpoint-pen-374820.jpg","width":1000,"height":667},{"@type":"BreadcrumbList","@id":"https:\/\/careerkarma.com\/blog\/how-to-use-java-constructors\/#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 Java Constructors"}]},{"@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\/13514","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=13514"}],"version-history":[{"count":0,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/posts\/13514\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/media\/13491"}],"wp:attachment":[{"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/media?parent=13514"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/categories?post=13514"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/tags?post=13514"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}