{"id":34340,"date":"2021-05-21T19:17:04","date_gmt":"2021-05-21T13:47:04","guid":{"rendered":"https:\/\/www.mygreatlearning.com\/blog\/methods-in-java\/"},"modified":"2024-09-03T14:23:58","modified_gmt":"2024-09-03T08:53:58","slug":"methods-in-java","status":"publish","type":"post","link":"https:\/\/www.mygreatlearning.com\/blog\/methods-in-java\/","title":{"rendered":"Methods in Java"},"content":{"rendered":"\n<p>Since Java is a general-purpose programming language, you'll need certain functions to be implemented and invoked on time for a successful application development. The block of code written to perform a certain dedicated function is known as a method. In this blog, you'll learn more on Methods in Java.<\/p>\n\n\n\n<p><strong>Let\u2019s start learning!<\/strong><\/p>\n\n\n\n    <div class=\"courses-cta-container\">\n        <div class=\"courses-cta-card\">\n            <div class=\"courses-cta-header\">\n                <div class=\"courses-learn-icon\"><\/div>\n                <span class=\"courses-learn-text\">Academy Pro<\/span>\n            <\/div>\n            <p class=\"courses-cta-title\">\n                <a href=\"https:\/\/www.mygreatlearning.com\/academy\/premium\/master-java-programming\" class=\"courses-cta-title-link\">Java Programming Course<\/a>\n            <\/p>\n            <p class=\"courses-cta-description\">Learn Java the right way! Our course teaches you essential programming skills, from coding basics to complex projects, setting you up for success in the tech industry.<\/p>\n            <div class=\"courses-cta-stats\">\n                <div class=\"courses-stat-item\">\n                    <div class=\"courses-stat-icon courses-user-icon\"><\/div>\n                    <span>16.05 Hrs<\/span>\n                <\/div>\n                <div class=\"courses-stat-item\">\n                    <div class=\"courses-stat-icon courses-star-icon\"><\/div>\n                    <span>3 Projects<\/span>\n                <\/div>\n            <\/div>\n            <a href=\"https:\/\/www.mygreatlearning.com\/academy\/premium\/master-java-programming\" class=\"courses-cta-button\">\n                Learn Java Programming\n                <div class=\"courses-arrow-icon\"><\/div>\n            <\/a>\n        <\/div>\n    <\/div>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"what-is-a-method\"><strong>What is a Method? <\/strong><\/h2>\n\n\n\n<p>A method is a set of code that can be named after the program scenario (E.g. For a program to add two numbers, method names can be sum ( ); ) and they can be invoked (called) at any point in a program to perform specific functions, by using the same name mentioned during declaration.&nbsp;<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Methods save time as well as retyping of code for a programmer.<\/li>\n\n\n\n<li>Methods can be reused in any other program \/ application and reduce the processing time.&nbsp;<\/li>\n\n\n\n<li>Methods are easy to call and once the body of the method is executed, it returns to the next line of the code and continues until the program ends.&nbsp;<\/li>\n\n\n\n<li>Using methods helps in performing same operations multiple times&nbsp;<\/li>\n\n\n\n<li>It reduces the size of the program \/ project<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"different-types-of-methods-in-java\"><strong>Different Types of Methods in Java <\/strong><\/h2>\n\n\n\n<p>There are two types of methods in Java&nbsp;<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"1-pre-defined-methods-standard-library-methods-system-defined-methods\"><strong>1. Pre \u2013 Defined Methods\/ Standard Library Methods\/System defined Methods:&nbsp;<\/strong><\/h3>\n\n\n\n<p>These are built \u2013 in methods in Java, which are instantly available to use in your program. The Java class library will be present in java archive (i.e., *jar) file with Java Virtual Machine (JVM) and Java Runtime Environment.&nbsp;<\/p>\n\n\n\n<p><strong>Examples:<\/strong><\/p>\n\n\n\n<p>Math functions \u2013 sqrt(), log(), min(), max(), avg(), sin(), cos(), tan(), round(),floor(), abs() etc.<\/p>\n\n\n\n<p>String function \u2013 length( ),&nbsp; substring ( ), replace ( ), charAt ( ), indexOf&nbsp; ( ) , trim ( ) etc.<\/p>\n\n\n\n<p><strong>Sample Program:&nbsp;<\/strong><\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\npublic class Main \n{\npublic static void main(String&#x5B;] args) \n{\nString targetString = &quot;Java is fun to learn&quot;;\nString str1= &quot;JAVA&quot;;\nString str 2= &quot;Java&quot;;\nString str 3 = &quot;  Hello Java  &quot;;\nSystem.out.println(&quot;Checking Length: &quot;+ targetString.length());\nchar &#x5B;] charArray = str2.toCharArray();\nSystem.out.println(&quot;Size of char array: &quot; + charArray.length);\nSystem.out.println(&quot;Printing last element of array: &quot; + charArray&#x5B;3]);\n}\n}\n\n<\/pre><\/div>\n\n\n<h3 class=\"wp-block-heading\" id=\"2-user-defined-methods\"><strong>2. User \u2013 defined Methods:&nbsp;<\/strong><\/h3>\n\n\n\n<p>These methods are created by the programmers for their requirement as per the programming scenario \/ necessity.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"2-1-method-with-returning-a-value\"><strong>2.1 Method with returning a value<\/strong><\/h4>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"2-1-1-calling-method-by-invoking-object\"><strong>2.1.1 Calling method by invoking Object<\/strong><\/h4>\n\n\n\n<p><strong>SYNTAX:&nbsp;<\/strong><\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nWrite Method\n\/\/ Before main Method\naccessModifier returnType methodName(Parameters)\n{\nStatements\n\u2014\u2014\u2014\n\u2014\u2014\u2014\n\u2014\u2014\u2014\n}\n--------------------------------------------------------------------\n\/\/After main method\nCall Method\n\/\/Create Object\nClassName objectName = new ClassName( );\n\/\/Call Method by invoking object\ndataType variableName = object.method(values..);\nor\nSystem.out.println(object.method( ));\n\n<\/pre><\/div>\n\n\n<h4 class=\"wp-block-heading\" id=\"2-1-2-calling-method-without-invoking-object\"><strong>2.1.2 Calling method without invoking Object<\/strong><\/h4>\n\n\n\n<p><strong>SYNTAX:<\/strong><\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\naccessModifier nonAccessModifier returnType methodName(Parameters)\n{\nStatements\n\u2014\u2014\u2014\u2014\n\u2014\u2014\u2014\u2014\n\u2014\u2014\u2014\u2014\n}\nCall Method\ndataType variableName = methodName(values);\nor\nSystem.out.println(methodname(values);\n\n<\/pre><\/div>\n\n\n<h4 class=\"wp-block-heading\" id=\"2-2-method-without-returning-any-value\"><strong>2.2 Method without returning any value<\/strong><\/h4>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"2-2-1-calling-method-by-invoking-object\"><strong>2.2.1 Calling method by invoking Object<\/strong><\/h4>\n\n\n\n<p><strong>SYNTAX:<\/strong><\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\naccessModifier returnTypeNothing methodName(parameters)\n{\nStatements\n\u2014\u2014\u2014-\n\u2014\u2014\u2014-\n\u2014\u2014\u2014\n}\n\/\/Create Object\nClassName objectName = new ClassName();\n\n\/\/Call Method\nobject.method(values);\n\n<\/pre><\/div>\n\n\n<h4 class=\"wp-block-heading\" id=\"2-2-2-calling-method-without-invoking-object\"><strong>2.2.2 Calling method without invoking Object<\/strong><\/h4>\n\n\n\n<p>&nbsp;<strong>SYNTAX:&nbsp;<\/strong><\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\naccessModifier nonAccessModifier returnTypeNothing methoName(Parameters){\nStatements\n\u2014\u2014\u2014\n\u2014\u2014\u2014\n\u2014\u2014\u2014\n}\nCall method\nmethodName(values);\n\n<\/pre><\/div>\n\n\n<h2 class=\"wp-block-heading\" id=\"how-to-create-a-method\"><strong>How to Create a Method? <\/strong><\/h2>\n\n\n\n<p>A method must be declared within a class. It must contain the name of the method for identification, preceding with parentheses ( ). Java provides some pre-defined ( system defined) methods, for example System.out.println(), but user defined methods can also be created.&nbsp;<\/p>\n\n\n\n<p><strong>SYNTAX:<\/strong><\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\npublic class Main \n{\n  static void mydemo() \n{\n    \/\/ code to be executed\n  }\n     }\n   Where, mydemo( ) is method name\n\n<\/pre><\/div>\n\n\n<h2 class=\"wp-block-heading\" id=\"how-to-call-a-method-method-calling\"><strong>How to call a Method? (Method Calling)<\/strong><\/h2>\n\n\n\n<p>A method in java is called by its name, we declare method with a name and common braces with semicolon;<\/p>\n\n\n\n<p>Syntax: methodname ( );<\/p>\n\n\n\n<p>Ex: javamethod( );<\/p>\n\n\n\n<p>In the following example, javaMethod() is used to print a text (the function), when it is called:<\/p>\n\n\n\n<p><strong>Sample Program:&nbsp;<\/strong><\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\npublic class Main \n{\n  static void javaMethod()\n {\n    System.out.println(&quot; Java is easy to learn &quot;);\n  }\n  public static void main(String&#x5B;] args)\n {\n    javaMethod();\n  }\n}\n \n\n<\/pre><\/div>\n\n\n<p><strong>There are&nbsp; two conditions where method returns to caller, they are:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>When the return statement is executed.<\/li>\n\n\n\n<li>When the control reaches the method end at the closing brace.<\/li>\n<\/ul>\n\n\n\n<ul class=\"wp-block-list\">\n<li>When a Java program is on execution, if it encounters a method.<\/li>\n\n\n\n<li>The execution then leads to the myFunction() method and executes code inside the body of the method.<\/li>\n\n\n\n<li>After the execution of the method body is successful, the program returns to the next line and continues until the end.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"method-parameters\"><strong>Method Parameters<\/strong><\/h2>\n\n\n\n<p>The information passed to the methods is known as Parameters. Parameters are similar to the variables we use in normal.<\/p>\n\n\n\n<p>Parameters are mentioned after the method name, within the common braces. Multiple&nbsp; parameters&nbsp; can be added using comma separators. Similar to variable declaration.<\/p>\n\n\n\n<p>The example below has a method that takes a String in a method:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\npublic class Main {\n  static void myMethod(String fname) {\n    System.out.println(fname + &quot; Khan&quot;);\n  }\n\n  public static void main(String&#x5B;] args) {\n    myMethod(&quot;Salman&quot;);\n    myMethod(&quot;Shahrukh&quot;);\n    myMethod(&quot;Aamir&quot;);\n  }\n}\n\n<\/pre><\/div>\n\n\n<h4 class=\"wp-block-heading\" id=\"methods-with-multiple-parameters\"><strong>Methods with multiple parameters:&nbsp;<\/strong><\/h4>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\npublic class Main {\n  static void myMethod(String fname, int age) {\n    System.out.println(fname + &quot; is &quot; + age);\n  }\n\n  public static void main(String&#x5B;] args) {\n    myMethod(&quot;Sneha&quot;, 25);\n    myMethod(&quot;Sanjana&quot;, 21);\n    myMethod(&quot;Anju&quot;, 20);\n  }\n}\n\n<\/pre><\/div>\n\n\n<h4 class=\"wp-block-heading\" id=\"return-values\"><strong>Return Values:<\/strong><\/h4>\n\n\n\n<p>We have learnt only void keyword in the method which means it should not return any value. If the value to be returned by the method then&nbsp; you can use data types such as int, char etc. So use the return keyword instead of void in the method:&nbsp;<\/p>\n\n\n\n<p>In this example we are passing value 19 to the method to add it with 5:&nbsp;<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\npublic class Main\n {\n  static int sum(int x) \n{\n    return 5 + x;\n  }\n  public static void main(String&#x5B;] args) \n{\n    System.out.println(sum(19));\n  }\n}\n\n<\/pre><\/div>\n\n\n<p><strong>OUTPUT:<\/strong> 24<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"memory-allocation-for-method-calls\"><strong>Memory Allocation for Method Calls <\/strong><\/h2>\n\n\n\n<p>In order to make static memory allocation and execution of the codes\/ methods we use STACK MEMORY in Java. Access to this memory is in Last-In-First-Out (LIFO) order as the stack by nature follows LIFO. A new block on stack top is created when we call new method that contains specific values related to that method, like parameters and reference objects. After method execution is complete, its stack frame is cleared, the execution returns back to the&nbsp;calling method and the empty pace will be available for the upcoming method.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"key-features-of-stack-memory\"><strong>Key Features of Stack Memory<\/strong><\/h4>\n\n\n\n<ul class=\"wp-block-list\">\n<li>It increases and decreases as new methods are called and returned respectively.<\/li>\n\n\n\n<li>Variables lifetime inside a stack until the method that created them is in execution.<\/li>\n\n\n\n<li>The memory space is automatically allocated and deallocated as per method execution<\/li>\n\n\n\n<li>If this memory is full, Java throws error i.e.,java.lang.StackOverFlowError<\/li>\n\n\n\n<li>Access to this memory is fast.This memory is thread safe as each thread operates in its own&nbsp;Stack<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"example-program-to-understand-memory-allocation\"><strong>Example Program to understand Memory Allocation:<\/strong><\/h4>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nclass Person {\n    int id;\n    String name;\n\n    public Person(int id, String name) {\n        this.id = id;\n        this.name = name;\n    }\n}\n\npublic class PersonBuilder {\n    private static Person buildPerson(int id, String name) {\n        return new Person(id, name);\n    }\n\n    public static void main(String&#x5B;] args) {\n        int id = 23;\n        String name = &quot;John&quot;;\n        Person person = null;\n        person = buildPerson(id, name);\n    }\n}\n\n<\/pre><\/div>\n\n\n<ol class=\"wp-block-list\">\n<li>After the cursor enters the main ( ) function, a memory space in the stack will be created to store the method parameters and references&nbsp; related to&nbsp; the method.\n<ul class=\"wp-block-list\">\n<li>The value of integer&nbsp;<em>id<\/em>&nbsp;will be stored in the stack memory directly.&nbsp;<\/li>\n\n\n\n<li>The reference&nbsp;variable&nbsp;<em>person&nbsp;<\/em>of type&nbsp;<em>Person&nbsp;<\/em>will also be created in stack memory which will point to the actual object in the heap space.<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>On top of the previous stack, the call to the constructor&nbsp;<em>Person(int, String)<\/em>&nbsp;from&nbsp;<em>main()<\/em>&nbsp;will allocate further memory. This will store:\n<ul class=\"wp-block-list\">\n<li>The&nbsp;<em>this<\/em>&nbsp;object is reference to the calling object in the stack<\/li>\n\n\n\n<li>The value&nbsp;<em>id&nbsp;<\/em>in the stack memory<\/li>\n\n\n\n<li>The actual string from the string pool in heap memory will be pointed by the reference variable of String argument name.<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>The next method called by the main method is buildPerson( ), for which the memory allocation will be on top of the previous one on the stack.<\/li>\n\n\n\n<li>&nbsp;All the variables will be stored in heap memory including the newly created object person of type Person.<\/li>\n<\/ol>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"summary\"><strong>Summary<\/strong><\/h2>\n\n\n\n<p>Before we conclude this article, let's quickly summarize the features of the stack memory.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td><strong>Parameter<\/strong><\/td><td><strong>Stack Memory<\/strong><\/td><\/tr><tr><td><strong>Application<\/strong><\/td><td>Stack is used to execute the threads individually one after the other. Having separate blocks, which is cleared later and replaced by next method\/thread.<\/td><td><\/td><\/tr><tr><td><strong>Size<\/strong><\/td><td>Stack is usually smaller than heap , its size limits depends upon the operating system architecture.<\/td><td><\/td><\/tr><tr><td><strong>Storage<\/strong><\/td><td>It stores only primitive variables and references to objects created in Heap Space<\/td><td><\/td><\/tr><tr><td><strong>Order<\/strong><\/td><td>It follows LIFO ( Last in First Out ) memory allocation system<\/td><td><\/td><\/tr><tr><td><strong>Life<\/strong><\/td><td>The memory allocated to the parameters of a method inside a stack only exists as long as the current method is running.<\/td><td><\/td><\/tr><tr><td><strong>Efficiency<\/strong><\/td><td>It has much faster memory allocation capacity than heap<\/td><td><\/td><\/tr><tr><td><strong>Allocation\/Deallocation<\/strong><\/td><td>Stack memory is automatically allocated\/ deallocated according to the method\u2019s nature when it is called or when the execution is complete<\/td><td><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>This brings us to the end of the blog on Methods in Java. If you wish to learn more such concepts, head over to <a rel=\"noreferrer noopener\" href=\"https:\/\/www.mygreatlearning.com\/academy\" target=\"_blank\">Great Learning Academy and take up the Free Online Courses. <\/a><\/p>\n\n\n\n<p>Also read: <a href=\"https:\/\/www.mygreatlearning.com\/blog\/java-tutorial-for-beginners\/\" target=\"_blank\" rel=\"noreferrer noopener\">Java Tutorial for Beginners | An Overview of Java<\/a><\/p>\n\n\n\n<p>Engaging in the study of Java programming suggests a keen interest in the realm of software development. For those embarking upon this journey with aspirations towards a career in this field, it is recommended to explore the following pages in order to acquire a comprehensive understanding of the development career path:<\/p>\n\n\n\n<figure class=\"wp-block-table aligncenter\"><table class=\"has-cyan-bluish-gray-background-color has-background\"><tbody><tr><td><a href=\"https:\/\/www.mygreatlearning.com\/software-engineering\/courses\/certificates\" target=\"_blank\" rel=\"noreferrer noopener\">Software engineering courses certificates<\/a><\/td><\/tr><tr><td><a href=\"https:\/\/www.mygreatlearning.com\/software-engineering\/courses\/placements\" target=\"_blank\" rel=\"noreferrer noopener\">Software engineering courses placements<\/a><\/td><\/tr><tr><td><a href=\"https:\/\/www.mygreatlearning.com\/software-engineering\/courses\/syllabus\" target=\"_blank\" rel=\"noreferrer noopener\">Software engineering courses syllabus<\/a><\/td><\/tr><tr><td><a href=\"https:\/\/www.mygreatlearning.com\/software-engineering\/courses\/fees\" target=\"_blank\" rel=\"noreferrer noopener\">Software engineering courses fees<\/a><\/td><\/tr><tr><td><a href=\"https:\/\/www.mygreatlearning.com\/software-engineering\/courses\/eligibility\" target=\"_blank\" rel=\"noreferrer noopener\">Software engineering courses eligibility<\/a><\/td><\/tr><\/tbody><\/table><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>Since Java is a general-purpose programming language, you'll need certain functions to be implemented and invoked on time for a successful application development. The block of code written to perform a certain dedicated function is known as a method. In this blog, you'll learn more on Methods in Java. Let\u2019s start learning! What is a [&hellip;]<\/p>\n","protected":false},"author":41,"featured_media":34365,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_uag_custom_page_level_css":"","site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"set","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[25860],"tags":[36826],"content_type":[],"class_list":["post-34340","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-software","tag-java"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v27.3 (Yoast SEO v27.3) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Methods in Java | What are Methods in Java? - Great Learning<\/title>\n<meta name=\"description\" content=\"A method is a set of code that can be named after the program scenario. In this blog, you&#039;ll learn more on Methods in Java.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.mygreatlearning.com\/blog\/methods-in-java\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Methods in Java\" \/>\n<meta property=\"og:description\" content=\"A method is a set of code that can be named after the program scenario. In this blog, you&#039;ll learn more on Methods in Java.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.mygreatlearning.com\/blog\/methods-in-java\/\" \/>\n<meta property=\"og:site_name\" content=\"Great Learning Blog: Free Resources what Matters to shape your Career!\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/GreatLearningOfficial\/\" \/>\n<meta property=\"article:published_time\" content=\"2021-05-21T13:47:04+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-09-03T08:53:58+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2021\/05\/iStock-1128132157.jpeg\" \/>\n\t<meta property=\"og:image:width\" content=\"1254\" \/>\n\t<meta property=\"og:image:height\" content=\"836\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Great Learning Editorial Team\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@https:\/\/twitter.com\/Great_Learning\" \/>\n<meta name=\"twitter:site\" content=\"@Great_Learning\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Great Learning Editorial Team\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/methods-in-java\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/methods-in-java\\\/\"},\"author\":{\"name\":\"Great Learning Editorial Team\",\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/#\\\/schema\\\/person\\\/6f993d1be4c584a335951e836f2656ad\"},\"headline\":\"Methods in Java\",\"datePublished\":\"2021-05-21T13:47:04+00:00\",\"dateModified\":\"2024-09-03T08:53:58+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/methods-in-java\\\/\"},\"wordCount\":1284,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/methods-in-java\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/wp-content\\\/uploads\\\/2021\\\/05\\\/iStock-1128132157.jpeg\",\"keywords\":[\"java\"],\"articleSection\":[\"IT\\\/Software Development\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/methods-in-java\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/methods-in-java\\\/\",\"url\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/methods-in-java\\\/\",\"name\":\"Methods in Java | What are Methods in Java? - Great Learning\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/methods-in-java\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/methods-in-java\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/wp-content\\\/uploads\\\/2021\\\/05\\\/iStock-1128132157.jpeg\",\"datePublished\":\"2021-05-21T13:47:04+00:00\",\"dateModified\":\"2024-09-03T08:53:58+00:00\",\"description\":\"A method is a set of code that can be named after the program scenario. In this blog, you'll learn more on Methods in Java.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/methods-in-java\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/methods-in-java\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/methods-in-java\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/wp-content\\\/uploads\\\/2021\\\/05\\\/iStock-1128132157.jpeg\",\"contentUrl\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/wp-content\\\/uploads\\\/2021\\\/05\\\/iStock-1128132157.jpeg\",\"width\":1254,\"height\":836,\"caption\":\"methods in java\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/methods-in-java\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Blog\",\"item\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"IT\\\/Software Development\",\"item\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/software\\\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Methods in Java\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/\",\"name\":\"Great Learning Blog\",\"description\":\"Learn, Upskill &amp; Career Development Guide and Resources\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/#organization\"},\"alternateName\":\"Great Learning\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/#organization\",\"name\":\"Great Learning\",\"url\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/GL-Logo.jpg\",\"contentUrl\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/GL-Logo.jpg\",\"width\":900,\"height\":900,\"caption\":\"Great Learning\"},\"image\":{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/GreatLearningOfficial\\\/\",\"https:\\\/\\\/x.com\\\/Great_Learning\",\"https:\\\/\\\/www.instagram.com\\\/greatlearningofficial\\\/\",\"https:\\\/\\\/www.linkedin.com\\\/school\\\/great-learning\\\/\",\"https:\\\/\\\/in.pinterest.com\\\/greatlearning12\\\/\",\"https:\\\/\\\/www.youtube.com\\\/user\\\/beaconelearning\\\/\"],\"description\":\"Great Learning is a leading global ed-tech company for professional training and higher education. It offers comprehensive, industry-relevant, hands-on learning programs across various business, technology, and interdisciplinary domains driving the digital economy. These programs are developed and offered in collaboration with the world's foremost academic institutions.\",\"email\":\"info@mygreatlearning.com\",\"legalName\":\"Great Learning Education Services Pvt. Ltd\",\"foundingDate\":\"2013-11-29\",\"numberOfEmployees\":{\"@type\":\"QuantitativeValue\",\"minValue\":\"1001\",\"maxValue\":\"5000\"}},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/#\\\/schema\\\/person\\\/6f993d1be4c584a335951e836f2656ad\",\"name\":\"Great Learning Editorial Team\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/02\\\/unnamed.webp\",\"url\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/02\\\/unnamed.webp\",\"contentUrl\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/02\\\/unnamed.webp\",\"caption\":\"Great Learning Editorial Team\"},\"description\":\"The Great Learning Editorial Staff includes a dynamic team of subject matter experts, instructors, and education professionals who combine their deep industry knowledge with innovative teaching methods. Their mission is to provide learners with the skills and insights needed to excel in their careers, whether through upskilling, reskilling, or transitioning into new fields.\",\"sameAs\":[\"https:\\\/\\\/www.mygreatlearning.com\\\/\",\"https:\\\/\\\/in.linkedin.com\\\/school\\\/great-learning\\\/\",\"https:\\\/\\\/x.com\\\/https:\\\/\\\/twitter.com\\\/Great_Learning\",\"https:\\\/\\\/www.youtube.com\\\/channel\\\/UCObs0kLIrDjX2LLSybqNaEA\"],\"award\":[\"Best EdTech Company of the Year 2024\",\"Education Economictimes Outstanding Education\\\/Edtech Solution Provider of the Year 2024\",\"Leading E-learning Platform 2024\"],\"url\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/author\\\/greatlearning\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Methods in Java | What are Methods in Java? - Great Learning","description":"A method is a set of code that can be named after the program scenario. In this blog, you'll learn more on Methods in Java.","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:\/\/www.mygreatlearning.com\/blog\/methods-in-java\/","og_locale":"en_US","og_type":"article","og_title":"Methods in Java","og_description":"A method is a set of code that can be named after the program scenario. In this blog, you'll learn more on Methods in Java.","og_url":"https:\/\/www.mygreatlearning.com\/blog\/methods-in-java\/","og_site_name":"Great Learning Blog: Free Resources what Matters to shape your Career!","article_publisher":"https:\/\/www.facebook.com\/GreatLearningOfficial\/","article_published_time":"2021-05-21T13:47:04+00:00","article_modified_time":"2024-09-03T08:53:58+00:00","og_image":[{"width":1254,"height":836,"url":"http:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2021\/05\/iStock-1128132157.jpeg","type":"image\/jpeg"}],"author":"Great Learning Editorial Team","twitter_card":"summary_large_image","twitter_creator":"@https:\/\/twitter.com\/Great_Learning","twitter_site":"@Great_Learning","twitter_misc":{"Written by":"Great Learning Editorial Team","Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.mygreatlearning.com\/blog\/methods-in-java\/#article","isPartOf":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/methods-in-java\/"},"author":{"name":"Great Learning Editorial Team","@id":"https:\/\/www.mygreatlearning.com\/blog\/#\/schema\/person\/6f993d1be4c584a335951e836f2656ad"},"headline":"Methods in Java","datePublished":"2021-05-21T13:47:04+00:00","dateModified":"2024-09-03T08:53:58+00:00","mainEntityOfPage":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/methods-in-java\/"},"wordCount":1284,"commentCount":0,"publisher":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/#organization"},"image":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/methods-in-java\/#primaryimage"},"thumbnailUrl":"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2021\/05\/iStock-1128132157.jpeg","keywords":["java"],"articleSection":["IT\/Software Development"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.mygreatlearning.com\/blog\/methods-in-java\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.mygreatlearning.com\/blog\/methods-in-java\/","url":"https:\/\/www.mygreatlearning.com\/blog\/methods-in-java\/","name":"Methods in Java | What are Methods in Java? - Great Learning","isPartOf":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/methods-in-java\/#primaryimage"},"image":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/methods-in-java\/#primaryimage"},"thumbnailUrl":"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2021\/05\/iStock-1128132157.jpeg","datePublished":"2021-05-21T13:47:04+00:00","dateModified":"2024-09-03T08:53:58+00:00","description":"A method is a set of code that can be named after the program scenario. In this blog, you'll learn more on Methods in Java.","breadcrumb":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/methods-in-java\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.mygreatlearning.com\/blog\/methods-in-java\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.mygreatlearning.com\/blog\/methods-in-java\/#primaryimage","url":"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2021\/05\/iStock-1128132157.jpeg","contentUrl":"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2021\/05\/iStock-1128132157.jpeg","width":1254,"height":836,"caption":"methods in java"},{"@type":"BreadcrumbList","@id":"https:\/\/www.mygreatlearning.com\/blog\/methods-in-java\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Blog","item":"https:\/\/www.mygreatlearning.com\/blog\/"},{"@type":"ListItem","position":2,"name":"IT\/Software Development","item":"https:\/\/www.mygreatlearning.com\/blog\/software\/"},{"@type":"ListItem","position":3,"name":"Methods in Java"}]},{"@type":"WebSite","@id":"https:\/\/www.mygreatlearning.com\/blog\/#website","url":"https:\/\/www.mygreatlearning.com\/blog\/","name":"Great Learning Blog","description":"Learn, Upskill &amp; Career Development Guide and Resources","publisher":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/#organization"},"alternateName":"Great Learning","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.mygreatlearning.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.mygreatlearning.com\/blog\/#organization","name":"Great Learning","url":"https:\/\/www.mygreatlearning.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.mygreatlearning.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2022\/06\/GL-Logo.jpg","contentUrl":"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2022\/06\/GL-Logo.jpg","width":900,"height":900,"caption":"Great Learning"},"image":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/GreatLearningOfficial\/","https:\/\/x.com\/Great_Learning","https:\/\/www.instagram.com\/greatlearningofficial\/","https:\/\/www.linkedin.com\/school\/great-learning\/","https:\/\/in.pinterest.com\/greatlearning12\/","https:\/\/www.youtube.com\/user\/beaconelearning\/"],"description":"Great Learning is a leading global ed-tech company for professional training and higher education. It offers comprehensive, industry-relevant, hands-on learning programs across various business, technology, and interdisciplinary domains driving the digital economy. These programs are developed and offered in collaboration with the world's foremost academic institutions.","email":"info@mygreatlearning.com","legalName":"Great Learning Education Services Pvt. Ltd","foundingDate":"2013-11-29","numberOfEmployees":{"@type":"QuantitativeValue","minValue":"1001","maxValue":"5000"}},{"@type":"Person","@id":"https:\/\/www.mygreatlearning.com\/blog\/#\/schema\/person\/6f993d1be4c584a335951e836f2656ad","name":"Great Learning Editorial Team","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2022\/02\/unnamed.webp","url":"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2022\/02\/unnamed.webp","contentUrl":"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2022\/02\/unnamed.webp","caption":"Great Learning Editorial Team"},"description":"The Great Learning Editorial Staff includes a dynamic team of subject matter experts, instructors, and education professionals who combine their deep industry knowledge with innovative teaching methods. Their mission is to provide learners with the skills and insights needed to excel in their careers, whether through upskilling, reskilling, or transitioning into new fields.","sameAs":["https:\/\/www.mygreatlearning.com\/","https:\/\/in.linkedin.com\/school\/great-learning\/","https:\/\/x.com\/https:\/\/twitter.com\/Great_Learning","https:\/\/www.youtube.com\/channel\/UCObs0kLIrDjX2LLSybqNaEA"],"award":["Best EdTech Company of the Year 2024","Education Economictimes Outstanding Education\/Edtech Solution Provider of the Year 2024","Leading E-learning Platform 2024"],"url":"https:\/\/www.mygreatlearning.com\/blog\/author\/greatlearning\/"}]}},"uagb_featured_image_src":{"full":["https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2021\/05\/iStock-1128132157.jpeg",1254,836,false],"thumbnail":["https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2021\/05\/iStock-1128132157-150x150.jpeg",150,150,true],"medium":["https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2021\/05\/iStock-1128132157-300x200.jpeg",300,200,true],"medium_large":["https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2021\/05\/iStock-1128132157-768x512.jpeg",768,512,true],"large":["https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2021\/05\/iStock-1128132157-1024x683.jpeg",1024,683,true],"1536x1536":["https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2021\/05\/iStock-1128132157.jpeg",1254,836,false],"2048x2048":["https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2021\/05\/iStock-1128132157.jpeg",1254,836,false],"web-stories-poster-portrait":["https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2021\/05\/iStock-1128132157-640x836.jpeg",640,836,true],"web-stories-publisher-logo":["https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2021\/05\/iStock-1128132157-96x96.jpeg",96,96,true],"web-stories-thumbnail":["https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2021\/05\/iStock-1128132157-150x100.jpeg",150,100,true]},"uagb_author_info":{"display_name":"Great Learning Editorial Team","author_link":"https:\/\/www.mygreatlearning.com\/blog\/author\/greatlearning\/"},"uagb_comment_info":0,"uagb_excerpt":"Since Java is a general-purpose programming language, you'll need certain functions to be implemented and invoked on time for a successful application development. The block of code written to perform a certain dedicated function is known as a method. In this blog, you'll learn more on Methods in Java. Let\u2019s start learning! What is a&hellip;","_links":{"self":[{"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/posts\/34340","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/users\/41"}],"replies":[{"embeddable":true,"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/comments?post=34340"}],"version-history":[{"count":30,"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/posts\/34340\/revisions"}],"predecessor-version":[{"id":112394,"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/posts\/34340\/revisions\/112394"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/media\/34365"}],"wp:attachment":[{"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/media?parent=34340"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/categories?post=34340"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/tags?post=34340"},{"taxonomy":"content_type","embeddable":true,"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/content_type?post=34340"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}