{"id":77091,"date":"2022-07-27T10:05:12","date_gmt":"2022-07-27T04:35:12","guid":{"rendered":"https:\/\/www.mygreatlearning.com\/blog\/tostring-java\/"},"modified":"2024-09-12T14:11:50","modified_gmt":"2024-09-12T08:41:50","slug":"tostring-java","status":"publish","type":"post","link":"https:\/\/www.mygreatlearning.com\/blog\/tostring-java\/","title":{"rendered":"What is toString() Method in Java?"},"content":{"rendered":"\n<p>When programming a software solution, the developers create several user-defined classes that implement the code for their software solution. To assist the developers, all languages provide standard libraries that are sub-divided into packages. These packages may have built-in interfaces, classes, and methods. The classes and methods usually have pre-defined functionality that reduces the developers' workload while expanding the language's capabilities.&nbsp;<\/p>\n\n\n\n<p>Java also has a lot of standard libraries with packages that have a collection of user interfaces, classes, and methods. The classes in a package provide solutions within a common domain. For example, the java.applet has classes and methods to be used for applets, and the java.io has classes and methods for system input and output through data streams, and so on.<\/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-tostring\"><strong>What is toString?<\/strong><\/h2>\n\n\n\n<p>The toString method is a built-in method in the Object class in java. Object class is present in java.lang package, and it\u2019s the parent class of all classes. Every class in Java inherits the default implementation of the toString method.&nbsp;<\/p>\n\n\n\n<p><strong>Functionality and Return Values of toString method<\/strong><\/p>\n\n\n\n<p>The functionality of the toString method is to return a String representation of the object on which it\u2019s called. The method describes the object in String or converts a numeric value into a String.&nbsp;<\/p>\n\n\n\n<p><strong>Parameters and Syntax<\/strong><strong><br><\/strong>The generic form of the method is given below.&nbsp;<\/p>\n\n\n\n<p><strong>String toString()<\/strong><\/p>\n\n\n\n<p>The above form shows that the return type of the method is String. The method can also be used with objects and other data types, as shown below.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">static String toString(float num)\nstatic String toString(double num)\nstatic String toString(byte num)\nstatic String toString(boolean bool)<\/pre>\n\n\n\n<p>Another variation of the method accepts 2 arguments - a number and the base in which the number\u2019s String representation is required. An example is shown in the next section to see how this works. Its syntax is:&nbsp;&nbsp;&nbsp;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>static String toString(int num, int radix)<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"how-to-use-the-tostring-method\"><strong>How to use the toString() method<\/strong><\/h2>\n\n\n\n<p>The below examples show how the toString method can be used.<\/p>\n\n\n\n<p><strong><em>Example 1:<\/em><\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>public class Player{\npublic static void main(String args&#091;]){\nPlayer player= new Player();\nInteger jersey=7;\nSystem.out.println(player.toString());  \n}\n}<\/code><\/pre>\n\n\n\n<p>For example1, Player@7a81197d is printed to the console. Since \u2018player\u2019 is an object, the toString method\u2019s default implementation gives a String that describes the class name + \u2018@\u2019+ hashcode value of the object on which the method is called.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" class=\"wp-block-heading\" id=\"understanding-the-problem-without-the-tostring-method\"><strong>Understanding the problem without the toString() method<\/strong><\/h3>\n\n\n\n<p>When the toString method is not used explicitly in the println statement, it gets called by default, and println outputs the String representation of the object.&nbsp; Let\u2019s try that in our example:<\/p>\n\n\n\n<p><strong><em>Example2:<\/em><\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>public class Player{\npublic static void main(String args&#091;]){\nPlayer player= new Player();\nInteger jersey=7;\nSystem.out.println(player);  \n} }<\/code><\/pre>\n\n\n\n<p>The output is <strong>Player@7a81197d<\/strong>. <\/p>\n\n\n\n<p>The result is the same as in the previous example, showing that the toString method is called by default when println outputs an object. In both the cases above, the result doesn\u2019t serve any purpose, so we will override the default toString method and change how it works.&nbsp;<\/p>\n\n\n\n<p><strong><em>Example3:<\/em><\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>class Player1{\nString name;\nint jersey;\nString club;\n\n  \/\/Override the toString method\n  public String toString() {\n    return \"Player{\"+\"name=\"+name+\"\" +\",Jersey=\"+jersey+\",\"+\"Club=\"+club+\"}\";\n  }\n\nPlayer1(int jersey, String name, String club){\nthis.jersey=jersey;\nthis.name=name;\nthis.club=club;\n}\n\npublic static void main(String args&#091;]) {\n      Player1 player =  new Player1(10,\"Messi\",\"Paris Saint-Germain\");\n      System.out.println(player.toString()); \n}\n}<\/code><\/pre>\n\n\n\n<p>The result of the above examples is:<\/p>\n\n\n\n<p><strong>Player{name=Messi,Jersey=10,Club=Paris Saint-Germain}<\/strong><\/p>\n\n\n\n<p>As seen in the above code, the toString method has code that overrides the default implementation. When toString is called in the println statement, the new code of the toString method returns a value that gets printed. Even if the toString method is not called explicitly in println, it gets called by default, and the same output gets printed.<\/p>\n\n\n\n<p>The below example shows how the toString method can be used on an integer whose String value is required in a different base. Here 2400 is converted into base 8, and the String value is displayed.<\/p>\n\n\n\n<p><strong>Example 4:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>public class BaseChange{\npublic static void main(String args&#091;]){\n System.out.println(Integer.toString(2400,8)); \n}\n}<\/code><\/pre>\n\n\n\n<p><strong>The output of the above code is 4540.&nbsp;<\/strong><\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"advantage-of-java-tostring-method\"><strong>Advantage of Java toString() method<\/strong><\/h2>\n\n\n\n<p>The toString method is in the Object class, the parent class in java, so it\u2019s available in every class in java by default. The method can be used on any object required to be represented in a String format. This can help debug when you need the details of an object. Sometimes you may want to override the method to implement it the way you want. Either way, it\u2019s advantageous when you are programming in Java.<\/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\n\n\n<h2 class=\"wp-block-heading\" id=\"frequently-asked-questions-faqs\"><strong>Frequently Asked Questions (FAQs<\/strong>)<\/h2>\n\n\n\n<div class=\"schema-faq wp-block-yoast-faq-block\"><div class=\"schema-faq-section\" id=\"faq-question-1658859926473\"><strong class=\"schema-faq-question\">How<strong> do we call the toString () method?<\/strong><\/strong> <p class=\"schema-faq-answer\">The toString() method is present in the Object class; whenever it\u2019s called on an object, it returns the String representation of the object. When there\u2019s a need to describe an object in a simple String format, the toString method is applicable. The method may return just the name of the object, or it can be overridden to include more information about the object. This can be helpful n debugging or for any other purpose. Numeric data types, bytes, URLs, etc., can also be represented as String.\u00a0\u00a0<\/p> <\/div> <div class=\"schema-faq-section\" id=\"faq-question-1658859937283\"><strong class=\"schema-faq-question\"><strong>What is toString (), and why do we need it?<\/strong><\/strong> <p class=\"schema-faq-answer\">By default, the toString() method is called by println, but the method can also be called explicitly on any object. The method can be called on an object, like this - object.toString(), or a numeric value can be passed to the method as an argument, like this - Integer.toString(10).\u00a0<\/p> <\/div> <div class=\"schema-faq-section\" id=\"faq-question-1658859984758\"><strong class=\"schema-faq-question\"><strong>Where is the toString method in Java?<\/strong><\/strong> <p class=\"schema-faq-answer\">The toString method is in the Object class in java. Since it\u2019s the parent class of all classes, they inherit the default implementation of the toString method.<\/p> <\/div> <div class=\"schema-faq-section\" id=\"faq-question-1658860001612\"><strong class=\"schema-faq-question\"><strong>Does Java automatically use toString? If so, why is toString automatically called?<\/strong><\/strong> <p class=\"schema-faq-answer\">The toString method is automatically called when something is printed using println. It also gets called when an object is concatenated with a String and can be called explicitly when required.\u00a0<br\/><br\/>In the statement \u201cSystem.out.println\u201d, println is a public method of the PrintStream class. The implementation of the method println makes a call to String.valueOf(Object) method. Within the valueOf method, toString is called on the object passed as an argument to the valueOf method. Thus, toString method gets called automatically.\u00a0\u00a0<\/p> <\/div> <div class=\"schema-faq-section\" id=\"faq-question-1658860034024\"><strong class=\"schema-faq-question\"><strong>How do you create a toString method in Java?<\/strong><\/strong> <p class=\"schema-faq-answer\">The toString method already exists in all classes in Java as it\u2019s there in the parent class. So, there\u2019s no need to create it, but you can override the method as per your requirement.\u00a0<\/p> <\/div> <\/div>\n","protected":false},"excerpt":{"rendered":"<p>When programming a software solution, the developers create several user-defined classes that implement the code for their software solution. To assist the developers, all languages provide standard libraries that are sub-divided into packages. These packages may have built-in interfaces, classes, and methods. The classes and methods usually have pre-defined functionality that reduces the developers' workload [&hellip;]<\/p>\n","protected":false},"author":41,"featured_media":77155,"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-77091","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>What is toString() Method in Java?<\/title>\n<meta name=\"description\" content=\"What is tostring method in Java? Let us learn about tostring Java and how we can use them with the help of this blog!\" \/>\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\/tostring-java\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"What is toString() Method in Java?\" \/>\n<meta property=\"og:description\" content=\"What is tostring method in Java? Let us learn about tostring Java and how we can use them with the help of this blog!\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.mygreatlearning.com\/blog\/tostring-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=\"2022-07-27T04:35:12+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-09-12T08:41:50+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2022\/07\/computer-1836330_1280.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1280\" \/>\n\t<meta property=\"og:image:height\" content=\"629\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\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=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/tostring-java\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/tostring-java\\\/\"},\"author\":{\"name\":\"Great Learning Editorial Team\",\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/#\\\/schema\\\/person\\\/6f993d1be4c584a335951e836f2656ad\"},\"headline\":\"What is toString() Method in Java?\",\"datePublished\":\"2022-07-27T04:35:12+00:00\",\"dateModified\":\"2024-09-12T08:41:50+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/tostring-java\\\/\"},\"wordCount\":1071,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/tostring-java\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/07\\\/computer-1836330_1280.png\",\"keywords\":[\"java\"],\"articleSection\":[\"IT\\\/Software Development\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/tostring-java\\\/#respond\"]}]},{\"@type\":[\"WebPage\",\"FAQPage\"],\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/tostring-java\\\/\",\"url\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/tostring-java\\\/\",\"name\":\"What is toString() Method in Java?\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/tostring-java\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/tostring-java\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/07\\\/computer-1836330_1280.png\",\"datePublished\":\"2022-07-27T04:35:12+00:00\",\"dateModified\":\"2024-09-12T08:41:50+00:00\",\"description\":\"What is tostring method in Java? Let us learn about tostring Java and how we can use them with the help of this blog!\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/tostring-java\\\/#breadcrumb\"},\"mainEntity\":[{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/tostring-java\\\/#faq-question-1658859926473\"},{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/tostring-java\\\/#faq-question-1658859937283\"},{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/tostring-java\\\/#faq-question-1658859984758\"},{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/tostring-java\\\/#faq-question-1658860001612\"},{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/tostring-java\\\/#faq-question-1658860034024\"}],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/tostring-java\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/tostring-java\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/07\\\/computer-1836330_1280.png\",\"contentUrl\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/07\\\/computer-1836330_1280.png\",\"width\":1280,\"height\":629,\"caption\":\"tostring java\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/tostring-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\":\"What is toString() Method 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\\\/\"},{\"@type\":\"Question\",\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/tostring-java\\\/#faq-question-1658859926473\",\"position\":1,\"url\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/tostring-java\\\/#faq-question-1658859926473\",\"name\":\"How do we call the toString () method?\",\"answerCount\":1,\"acceptedAnswer\":{\"@type\":\"Answer\",\"text\":\"The toString() method is present in the Object class; whenever it\u2019s called on an object, it returns the String representation of the object. When there\u2019s a need to describe an object in a simple String format, the toString method is applicable. The method may return just the name of the object, or it can be overridden to include more information about the object. This can be helpful n debugging or for any other purpose. Numeric data types, bytes, URLs, etc., can also be represented as String.\u00a0\u00a0\",\"inLanguage\":\"en-US\"},\"inLanguage\":\"en-US\"},{\"@type\":\"Question\",\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/tostring-java\\\/#faq-question-1658859937283\",\"position\":2,\"url\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/tostring-java\\\/#faq-question-1658859937283\",\"name\":\"What is toString (), and why do we need it?\",\"answerCount\":1,\"acceptedAnswer\":{\"@type\":\"Answer\",\"text\":\"By default, the toString() method is called by println, but the method can also be called explicitly on any object. The method can be called on an object, like this - object.toString(), or a numeric value can be passed to the method as an argument, like this - Integer.toString(10).\u00a0\",\"inLanguage\":\"en-US\"},\"inLanguage\":\"en-US\"},{\"@type\":\"Question\",\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/tostring-java\\\/#faq-question-1658859984758\",\"position\":3,\"url\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/tostring-java\\\/#faq-question-1658859984758\",\"name\":\"Where is the toString method in Java?\",\"answerCount\":1,\"acceptedAnswer\":{\"@type\":\"Answer\",\"text\":\"The toString method is in the Object class in java. Since it\u2019s the parent class of all classes, they inherit the default implementation of the toString method.\",\"inLanguage\":\"en-US\"},\"inLanguage\":\"en-US\"},{\"@type\":\"Question\",\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/tostring-java\\\/#faq-question-1658860001612\",\"position\":4,\"url\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/tostring-java\\\/#faq-question-1658860001612\",\"name\":\"Does Java automatically use toString? If so, why is toString automatically called?\",\"answerCount\":1,\"acceptedAnswer\":{\"@type\":\"Answer\",\"text\":\"The toString method is automatically called when something is printed using println. It also gets called when an object is concatenated with a String and can be called explicitly when required.\u00a0<br\\\/><br\\\/>In the statement \u201cSystem.out.println\u201d, println is a public method of the PrintStream class. The implementation of the method println makes a call to String.valueOf(Object) method. Within the valueOf method, toString is called on the object passed as an argument to the valueOf method. Thus, toString method gets called automatically.\u00a0\u00a0\",\"inLanguage\":\"en-US\"},\"inLanguage\":\"en-US\"},{\"@type\":\"Question\",\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/tostring-java\\\/#faq-question-1658860034024\",\"position\":5,\"url\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/tostring-java\\\/#faq-question-1658860034024\",\"name\":\"How do you create a toString method in Java?\",\"answerCount\":1,\"acceptedAnswer\":{\"@type\":\"Answer\",\"text\":\"The toString method already exists in all classes in Java as it\u2019s there in the parent class. So, there\u2019s no need to create it, but you can override the method as per your requirement.\u00a0\",\"inLanguage\":\"en-US\"},\"inLanguage\":\"en-US\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"What is toString() Method in Java?","description":"What is tostring method in Java? Let us learn about tostring Java and how we can use them with the help of this blog!","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\/tostring-java\/","og_locale":"en_US","og_type":"article","og_title":"What is toString() Method in Java?","og_description":"What is tostring method in Java? Let us learn about tostring Java and how we can use them with the help of this blog!","og_url":"https:\/\/www.mygreatlearning.com\/blog\/tostring-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":"2022-07-27T04:35:12+00:00","article_modified_time":"2024-09-12T08:41:50+00:00","og_image":[{"width":1280,"height":629,"url":"http:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2022\/07\/computer-1836330_1280.png","type":"image\/png"}],"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":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.mygreatlearning.com\/blog\/tostring-java\/#article","isPartOf":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/tostring-java\/"},"author":{"name":"Great Learning Editorial Team","@id":"https:\/\/www.mygreatlearning.com\/blog\/#\/schema\/person\/6f993d1be4c584a335951e836f2656ad"},"headline":"What is toString() Method in Java?","datePublished":"2022-07-27T04:35:12+00:00","dateModified":"2024-09-12T08:41:50+00:00","mainEntityOfPage":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/tostring-java\/"},"wordCount":1071,"commentCount":0,"publisher":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/#organization"},"image":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/tostring-java\/#primaryimage"},"thumbnailUrl":"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2022\/07\/computer-1836330_1280.png","keywords":["java"],"articleSection":["IT\/Software Development"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.mygreatlearning.com\/blog\/tostring-java\/#respond"]}]},{"@type":["WebPage","FAQPage"],"@id":"https:\/\/www.mygreatlearning.com\/blog\/tostring-java\/","url":"https:\/\/www.mygreatlearning.com\/blog\/tostring-java\/","name":"What is toString() Method in Java?","isPartOf":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/tostring-java\/#primaryimage"},"image":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/tostring-java\/#primaryimage"},"thumbnailUrl":"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2022\/07\/computer-1836330_1280.png","datePublished":"2022-07-27T04:35:12+00:00","dateModified":"2024-09-12T08:41:50+00:00","description":"What is tostring method in Java? Let us learn about tostring Java and how we can use them with the help of this blog!","breadcrumb":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/tostring-java\/#breadcrumb"},"mainEntity":[{"@id":"https:\/\/www.mygreatlearning.com\/blog\/tostring-java\/#faq-question-1658859926473"},{"@id":"https:\/\/www.mygreatlearning.com\/blog\/tostring-java\/#faq-question-1658859937283"},{"@id":"https:\/\/www.mygreatlearning.com\/blog\/tostring-java\/#faq-question-1658859984758"},{"@id":"https:\/\/www.mygreatlearning.com\/blog\/tostring-java\/#faq-question-1658860001612"},{"@id":"https:\/\/www.mygreatlearning.com\/blog\/tostring-java\/#faq-question-1658860034024"}],"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.mygreatlearning.com\/blog\/tostring-java\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.mygreatlearning.com\/blog\/tostring-java\/#primaryimage","url":"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2022\/07\/computer-1836330_1280.png","contentUrl":"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2022\/07\/computer-1836330_1280.png","width":1280,"height":629,"caption":"tostring java"},{"@type":"BreadcrumbList","@id":"https:\/\/www.mygreatlearning.com\/blog\/tostring-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":"What is toString() Method 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\/"},{"@type":"Question","@id":"https:\/\/www.mygreatlearning.com\/blog\/tostring-java\/#faq-question-1658859926473","position":1,"url":"https:\/\/www.mygreatlearning.com\/blog\/tostring-java\/#faq-question-1658859926473","name":"How do we call the toString () method?","answerCount":1,"acceptedAnswer":{"@type":"Answer","text":"The toString() method is present in the Object class; whenever it\u2019s called on an object, it returns the String representation of the object. When there\u2019s a need to describe an object in a simple String format, the toString method is applicable. The method may return just the name of the object, or it can be overridden to include more information about the object. This can be helpful n debugging or for any other purpose. Numeric data types, bytes, URLs, etc., can also be represented as String.\u00a0\u00a0","inLanguage":"en-US"},"inLanguage":"en-US"},{"@type":"Question","@id":"https:\/\/www.mygreatlearning.com\/blog\/tostring-java\/#faq-question-1658859937283","position":2,"url":"https:\/\/www.mygreatlearning.com\/blog\/tostring-java\/#faq-question-1658859937283","name":"What is toString (), and why do we need it?","answerCount":1,"acceptedAnswer":{"@type":"Answer","text":"By default, the toString() method is called by println, but the method can also be called explicitly on any object. The method can be called on an object, like this - object.toString(), or a numeric value can be passed to the method as an argument, like this - Integer.toString(10).\u00a0","inLanguage":"en-US"},"inLanguage":"en-US"},{"@type":"Question","@id":"https:\/\/www.mygreatlearning.com\/blog\/tostring-java\/#faq-question-1658859984758","position":3,"url":"https:\/\/www.mygreatlearning.com\/blog\/tostring-java\/#faq-question-1658859984758","name":"Where is the toString method in Java?","answerCount":1,"acceptedAnswer":{"@type":"Answer","text":"The toString method is in the Object class in java. Since it\u2019s the parent class of all classes, they inherit the default implementation of the toString method.","inLanguage":"en-US"},"inLanguage":"en-US"},{"@type":"Question","@id":"https:\/\/www.mygreatlearning.com\/blog\/tostring-java\/#faq-question-1658860001612","position":4,"url":"https:\/\/www.mygreatlearning.com\/blog\/tostring-java\/#faq-question-1658860001612","name":"Does Java automatically use toString? If so, why is toString automatically called?","answerCount":1,"acceptedAnswer":{"@type":"Answer","text":"The toString method is automatically called when something is printed using println. It also gets called when an object is concatenated with a String and can be called explicitly when required.\u00a0<br\/><br\/>In the statement \u201cSystem.out.println\u201d, println is a public method of the PrintStream class. The implementation of the method println makes a call to String.valueOf(Object) method. Within the valueOf method, toString is called on the object passed as an argument to the valueOf method. Thus, toString method gets called automatically.\u00a0\u00a0","inLanguage":"en-US"},"inLanguage":"en-US"},{"@type":"Question","@id":"https:\/\/www.mygreatlearning.com\/blog\/tostring-java\/#faq-question-1658860034024","position":5,"url":"https:\/\/www.mygreatlearning.com\/blog\/tostring-java\/#faq-question-1658860034024","name":"How do you create a toString method in Java?","answerCount":1,"acceptedAnswer":{"@type":"Answer","text":"The toString method already exists in all classes in Java as it\u2019s there in the parent class. So, there\u2019s no need to create it, but you can override the method as per your requirement.\u00a0","inLanguage":"en-US"},"inLanguage":"en-US"}]}},"uagb_featured_image_src":{"full":["https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2022\/07\/computer-1836330_1280.png",1280,629,false],"thumbnail":["https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2022\/07\/computer-1836330_1280-150x150.png",150,150,true],"medium":["https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2022\/07\/computer-1836330_1280-300x147.png",300,147,true],"medium_large":["https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2022\/07\/computer-1836330_1280-768x377.png",768,377,true],"large":["https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2022\/07\/computer-1836330_1280-1024x503.png",1024,503,true],"1536x1536":["https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2022\/07\/computer-1836330_1280.png",1280,629,false],"2048x2048":["https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2022\/07\/computer-1836330_1280.png",1280,629,false],"web-stories-poster-portrait":["https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2022\/07\/computer-1836330_1280-640x629.png",640,629,true],"web-stories-publisher-logo":["https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2022\/07\/computer-1836330_1280-96x96.png",96,96,true],"web-stories-thumbnail":["https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2022\/07\/computer-1836330_1280-150x74.png",150,74,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":"When programming a software solution, the developers create several user-defined classes that implement the code for their software solution. To assist the developers, all languages provide standard libraries that are sub-divided into packages. These packages may have built-in interfaces, classes, and methods. The classes and methods usually have pre-defined functionality that reduces the developers' workload&hellip;","_links":{"self":[{"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/posts\/77091","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=77091"}],"version-history":[{"count":8,"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/posts\/77091\/revisions"}],"predecessor-version":[{"id":104517,"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/posts\/77091\/revisions\/104517"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/media\/77155"}],"wp:attachment":[{"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/media?parent=77091"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/categories?post=77091"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/tags?post=77091"},{"taxonomy":"content_type","embeddable":true,"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/content_type?post=77091"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}