{"id":13450,"date":"2020-03-17T18:40:15","date_gmt":"2020-03-18T01:40:15","guid":{"rendered":"https:\/\/careerkarma.com\/blog\/?p=13450"},"modified":"2023-12-01T02:32:59","modified_gmt":"2023-12-01T10:32:59","slug":"java-methods","status":"publish","type":"post","link":"https:\/\/careerkarma.com\/blog\/java-methods\/","title":{"rendered":"How to Use Java Methods"},"content":{"rendered":"\n<p>In object-oriented programming, methods are blocks of code that perform a specific task. For instance, a method could check whether a customer has enough money in their bank account to make a purchase or sort the contents of a list of student names in alphabetical order.<br><\/p>\n\n\n\n<p>This tutorial will discuss, with reference to examples, how to use methods in Java. We\u2019ll explore how to create a method, the Java method syntax, and how to call a method. By the end of reading this guide, you\u2019ll be an expert at using Java methods.<br><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Java Method Introduction<\/h2>\n\n\n\n<p>Java methods are used to define blocks of code that perform a specific task. Methods are also known as functions in object-oriented programming.<br><\/p>\n\n\n\n<p>There are two main reasons why developers use methods in their code. First, methods allow developers to reuse code. Once you have declared a method, you can reuse it multiple times in your code. So, if you need to execute the same task multiple times, you can call a method instead of retyping the code over again.<br><\/p>\n\n\n\n<p>Methods also make your code easier to read because your code will be stored in a specific block with its own name, instead of in the main program that you are writing.<br><\/p>\n\n\n\n<p>There are two types of methods in Java: standard library methods and user-defined methods.<br><\/p>\n\n\n\n<p>Standard library methods are the methods that are built-into the Java programming language. For instance, the <code>println()<\/code> method is part of the <code>java.io.PrintStream<\/code> library.<br><\/p>\n\n\n\n<p>Here\u2019s an example of a program that uses the built-in <code>println()<\/code> method:<br><\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>class Main {\n\tpublic static void main(String[] args) {\n\t\tSystem.out.println(\"This is a print statement.\");\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>This is a print statement.<\/pre><\/div>\n\n\n\n<p>User-defined methods, on the other hand, are methods that are defined inside a Java class.<br><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Java User-Defined Methods<\/h2>\n\n\n\n<p>In Java, user-defined methods are created by the user and are defined inside a class based on your needs. A user-defined method contains a block of code you have written that will be contained in a specific function in your code.<br><\/p>\n\n\n\n<p>Before you start using a method, you need to define (or declare) one. Here\u2019s the syntax for declaring a method in Java:<br><\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>modifier static returnType methodName (arguments) {\n\t\/\/ Code goes here\n}<\/pre><\/div>\n\n\n\n<p>Let\u2019s break down this syntax:<br><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>modifier<\/strong> is the access type the function will use (public, private, etc.).<\/li>\n\n\n\n<li><strong>static<\/strong> is an optional keyword that allows your method to be accessed without creating an object of the class.<\/li>\n\n\n\n<li><strong>returnType<\/strong> is the type of data returned by the method (int, float, String, double, etc.).<\/li>\n\n\n\n<li><strong>methodName<\/strong> is the name of the method you are declaring.<\/li>\n\n\n\n<li><strong>arguments<\/strong> are the values passed into a method. This parameter list can include zero, one, or multiple values.<\/li>\n<\/ul>\n\n\n\n<p>Let\u2019s walk through an example of a Java program that uses a method to demonstrate how this works.<br><\/p>\n\n\n\n<p>Suppose we are building an app for a local coffee shop that processes their orders. We want to create a program that prints out the message \u201cThe order is ready\u201d at the end of the program. We could accomplish this task using the following code:<br><\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>class Main {\n\tpublic static void orderReady() {\n\t\tSystem.out.println(\"The order is ready.\");\n\t}\n}<\/pre><\/div>\n\n\n\n<p>In our code, we have declared a method called <code>orderReady()<\/code>. On the first line, we declare a class called Main in which our main program is written.<br><\/p>\n\n\n\n<p>Next, we have created a method called <code>orderReady()<\/code>. <code>orderReady()<\/code> does not accept any arguments and does not return any values.<br><\/p>\n\n\n\n<p>When the <code>orderReady()<\/code> method is called, the code within the method body will be executed. So, the message <code>The order is ready.<\/code> will be printed to the console.<br><\/p>\n\n\n\n<p>Right now, though, our code does nothing. That\u2019s because we haven\u2019t called our method. In order to run the code in our method, we need to call it. Here\u2019s how we can call our method:<br><\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>import java.util.Scanner;\nclass Main {\n\tpublic static void orderReady() {\n\t\tSystem.out.println(\"The order is ready.\");\n\t}\n\tpublic static void main(String[] args) {\n\t\torderReady();\n\t}\n}<\/pre><\/div>\n\n\n\n<p>When we run our code, the following response is returned:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>The order is ready.<\/pre><\/div>\n\n\n\n<p>In our code above, we defined the main function, which includes the code for our main program. Then we called the <code>orderReady<\/code> function using <code>orderReady()<\/code>.<br><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Java Method with Arguments<\/h2>\n\n\n\n<p>In addition, Java methods can accept arguments passed through the method, which allows you to pass data through to a method. Suppose we wanted our message to print out <code>Order #[order number] is ready.<\/code>, which would make it clearer to the barista what order was ready. We could do so using this code:<br><\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>class Main {\npublic static void orderReady(int orderNumber) {\n\t\tSystem.out.println(\"Order #\" + orderNumber + \" is ready.\");\n\t}\n\tpublic static void main(String[] args) {\n\t\torderReady(12);\n\t}\n}<\/pre><\/div>\n\n\n\n<p>When we run our code, the following response is returned:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>Order #12 is ready.<\/pre><\/div>\n\n\n\n<p>In this example, our code accepts a parameter called orderNumber. We pass the value 12 as the orderNumber parameter above, which is then read by the <code>orderReady()<\/code> method. The <code>orderReady()<\/code> method returns, <code>Order #12 is ready.<\/code> in the above example, where 12 is the value we passed to the <code>orderNumber<\/code> parameter.<br><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Java Method with Return Value<\/h2>\n\n\n\n<p>Java methods can also return values to the main program. Suppose we are creating an app that multiplies two numbers together. We want to multiply these numbers in a function, then return the result to the main program.<br><\/p>\n\n\n\n<p>We could do so using the following code:<br><\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>class MultiplyNumbers {\n\tpublic static int multiplyNumbers(int numberOne, int numberTwo) {\n\t\treturn numberOne * numberTwo;\n\t}\n\tpublic static void main(String[] args) {\n\t\tint numberOne = 7;\n\t\tint numberTwo = 9;\n\t\tint multiplied = multiplyNumbers(numberOne, numberTwo);\n\t\tSystem.out.println(numberOne + \" x \" + numberTwo + \" is: \" + multiplied);\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>7 x 9 is: 63<\/pre><\/div>\n\n\n\n<p>In our code, the <code>multiplyNumbers()<\/code> method is used to multiply two numbers together. When we call <code>multiplyNumbers<\/code>, we need to specify two method parameters, which are the numbers we want to multiply together. In the above example, the numbers we multiply are 7 and 9.<br><\/p>\n\n\n\n<p>Then, our <code>multiplyNumbers()<\/code> method multiplies these two numbers together and returns the multiplied number. This number is then passed back to the main program.<br><\/p>\n\n\n\n<p>Here\u2019s what happens when we run our program, step-by-step:<br><\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>The variable <code>numberOne<\/code> is declared and assigned the value 7.<\/li>\n\n\n\n<li>The variable <code>numberTwo<\/code> is declared and assigned the value 9.<\/li>\n\n\n\n<li><code>multiplyNumbers()<\/code> is called and the variables <code>numberOne<\/code> and <code>numberTwo<\/code> are specified as parameters. The result of this method is assigned to the variable multiplied.<\/li>\n\n\n\n<li>A message is printed to the console stating \u201c[Number1] * [Number2] is: [Result]\u201d, where \u201cNumber1\u201d is the value of <code>numberOne<\/code>, \u201cNumber2\u201d is the value of <code>numberTwo<\/code>, and \u201cResult\u201d is the value of <code>multiplied<\/code>.<\/li>\n<\/ol>\n\n\n\n<iframe loading=\"lazy\" frameborder=\"0\" width=\"100%\" height=\"400px\" src=\"https:\/\/repl.it\/@careerkarma\/Java-Methods?lite=true\"><\/iframe>\n<br>\n<br>\n\n\n\n<h2 class=\"wp-block-heading\">Conclusion<\/h2>\n\n\n\n<p>Methods are a crucial part of object-oriented programming and allow you to define a block of code that performs a specific task and can be reused multiple times. Methods are used in Java to make code more readable and efficient.&nbsp;<br><\/p>\n\n\n\n<p>This tutorial discussed how to use methods in Java, how to call methods in Java, and how to use parameters and return statements in Java methods. After reading this tutorial, you\u2019ll be an expert at using methods in Java.<\/p>\n","protected":false},"excerpt":{"rendered":"In object-oriented programming, methods are blocks of code that perform a specific task. For instance, a method could check whether a customer has enough money in their bank account to make a purchase or sort the contents of a list of student names in alphabetical order. This tutorial will discuss, with reference to examples, how&hellip;","protected":false},"author":240,"featured_media":13451,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[17289],"tags":[],"class_list":{"0":"post-13450","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>Java Methods | Career Karma<\/title>\n<meta name=\"description\" content=\"Methods are blocks of code used by developers that perform a specific task. Learn how to write and call methods in Java 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\/java-methods\/\" \/>\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 Methods\" \/>\n<meta property=\"og:description\" content=\"Methods are blocks of code used by developers that perform a specific task. Learn how to write and call methods in Java code on Career Karma.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/careerkarma.com\/blog\/java-methods\/\" \/>\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:40:15+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-12-01T10:32:59+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/03\/man-wearing-black-button-up-long-sleeved-writing-of-board-1181309.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-methods\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/java-methods\/\"},\"author\":{\"name\":\"James Gallagher\",\"@id\":\"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/e79364792443fbff794a144c67ec8e94\"},\"headline\":\"How to Use Java Methods\",\"datePublished\":\"2020-03-18T01:40:15+00:00\",\"dateModified\":\"2023-12-01T10:32:59+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/java-methods\/\"},\"wordCount\":1009,\"commentCount\":0,\"image\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/java-methods\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/03\/man-wearing-black-button-up-long-sleeved-writing-of-board-1181309.jpg\",\"articleSection\":[\"Java\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/careerkarma.com\/blog\/java-methods\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/careerkarma.com\/blog\/java-methods\/\",\"url\":\"https:\/\/careerkarma.com\/blog\/java-methods\/\",\"name\":\"Java Methods | Career Karma\",\"isPartOf\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/java-methods\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/java-methods\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/03\/man-wearing-black-button-up-long-sleeved-writing-of-board-1181309.jpg\",\"datePublished\":\"2020-03-18T01:40:15+00:00\",\"dateModified\":\"2023-12-01T10:32:59+00:00\",\"author\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/e79364792443fbff794a144c67ec8e94\"},\"description\":\"Methods are blocks of code used by developers that perform a specific task. Learn how to write and call methods in Java code on Career Karma.\",\"breadcrumb\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/java-methods\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/careerkarma.com\/blog\/java-methods\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/careerkarma.com\/blog\/java-methods\/#primaryimage\",\"url\":\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/03\/man-wearing-black-button-up-long-sleeved-writing-of-board-1181309.jpg\",\"contentUrl\":\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/03\/man-wearing-black-button-up-long-sleeved-writing-of-board-1181309.jpg\",\"width\":1000,\"height\":668},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/careerkarma.com\/blog\/java-methods\/#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 Methods\"}]},{\"@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":"Java Methods | Career Karma","description":"Methods are blocks of code used by developers that perform a specific task. Learn how to write and call methods in Java 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\/java-methods\/","og_locale":"en_US","og_type":"article","og_title":"How to Use Java Methods","og_description":"Methods are blocks of code used by developers that perform a specific task. Learn how to write and call methods in Java code on Career Karma.","og_url":"https:\/\/careerkarma.com\/blog\/java-methods\/","og_site_name":"Career Karma","article_publisher":"http:\/\/facebook.com\/careerkarmaapp","article_published_time":"2020-03-18T01:40:15+00:00","article_modified_time":"2023-12-01T10:32:59+00:00","og_image":[{"width":1000,"height":668,"url":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/03\/man-wearing-black-button-up-long-sleeved-writing-of-board-1181309.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-methods\/#article","isPartOf":{"@id":"https:\/\/careerkarma.com\/blog\/java-methods\/"},"author":{"name":"James Gallagher","@id":"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/e79364792443fbff794a144c67ec8e94"},"headline":"How to Use Java Methods","datePublished":"2020-03-18T01:40:15+00:00","dateModified":"2023-12-01T10:32:59+00:00","mainEntityOfPage":{"@id":"https:\/\/careerkarma.com\/blog\/java-methods\/"},"wordCount":1009,"commentCount":0,"image":{"@id":"https:\/\/careerkarma.com\/blog\/java-methods\/#primaryimage"},"thumbnailUrl":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/03\/man-wearing-black-button-up-long-sleeved-writing-of-board-1181309.jpg","articleSection":["Java"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/careerkarma.com\/blog\/java-methods\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/careerkarma.com\/blog\/java-methods\/","url":"https:\/\/careerkarma.com\/blog\/java-methods\/","name":"Java Methods | Career Karma","isPartOf":{"@id":"https:\/\/careerkarma.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/careerkarma.com\/blog\/java-methods\/#primaryimage"},"image":{"@id":"https:\/\/careerkarma.com\/blog\/java-methods\/#primaryimage"},"thumbnailUrl":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/03\/man-wearing-black-button-up-long-sleeved-writing-of-board-1181309.jpg","datePublished":"2020-03-18T01:40:15+00:00","dateModified":"2023-12-01T10:32:59+00:00","author":{"@id":"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/e79364792443fbff794a144c67ec8e94"},"description":"Methods are blocks of code used by developers that perform a specific task. Learn how to write and call methods in Java code on Career Karma.","breadcrumb":{"@id":"https:\/\/careerkarma.com\/blog\/java-methods\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/careerkarma.com\/blog\/java-methods\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/careerkarma.com\/blog\/java-methods\/#primaryimage","url":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/03\/man-wearing-black-button-up-long-sleeved-writing-of-board-1181309.jpg","contentUrl":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/03\/man-wearing-black-button-up-long-sleeved-writing-of-board-1181309.jpg","width":1000,"height":668},{"@type":"BreadcrumbList","@id":"https:\/\/careerkarma.com\/blog\/java-methods\/#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 Methods"}]},{"@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\/13450","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=13450"}],"version-history":[{"count":0,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/posts\/13450\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/media\/13451"}],"wp:attachment":[{"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/media?parent=13450"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/categories?post=13450"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/tags?post=13450"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}