{"id":35562,"date":"2022-10-26T02:10:00","date_gmt":"2022-10-25T20:40:00","guid":{"rendered":"https:\/\/www.mygreatlearning.com\/blog\/multithreading-in-java\/"},"modified":"2025-01-23T03:28:19","modified_gmt":"2025-01-22T21:58:19","slug":"multithreading-in-java","status":"publish","type":"post","link":"https:\/\/www.mygreatlearning.com\/blog\/multithreading-in-java\/","title":{"rendered":"Multithreading in Java: Step-by-Step"},"content":{"rendered":"\n<p>Multithreading is a programming technique in which a program can perform several tasks simultaneously by breaking the tasks into smaller threads that may run independently. It also helps to improve the performance of applications, making them more responsive and efficient.&nbsp;<\/p>\n\n\n\n<p>Because Java is a solid and frequently used programming language, it offers considerable support for multithreading via its rich sets of APIs. Multithreading is important for modern software development, whether you are trying to improve the responsiveness of user interfaces, run background tasks, or optimize CPU utilization.&nbsp;<\/p>\n\n\n\n<p>In this article, we will first review basic multithreading and then learn some more advanced topics. You\u2019ll also learn how to use this feature effectively in Java with clear explanations and practical examples. Let\u2019s dive in!<\/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=\"threads-in-java\">Threads in Java<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"what-is-a-thread\">What is a Thread?<\/h3>\n\n\n\n<p>A thread is the smallest unit of a program that can run independently. In Java:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Each thread has its own lifecycle.<\/li>\n\n\n\n<li>Threads within the same application share memory, making communication efficient but requiring synchronization.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"process-vs-thread\">Process vs Thread<\/h3>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>Process<\/strong>: An independent program running in memory.<\/li>\n\n\n\n<li><strong>Thread<\/strong>: A smaller, lightweight unit within a process.<\/li>\n<\/ol>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"difference-between-multithreading-and-multitasking\">Difference Between Multithreading and Multitasking<\/h3>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><tbody><tr><td><strong>Aspect<\/strong><\/td><td><strong>Multithreading<\/strong><\/td><td><strong>Multitasking<\/strong><\/td><\/tr><tr><td>Scope<\/td><td>Multiple threads in one process<\/td><td>Multiple processes running simultaneously<\/td><\/tr><tr><td>Memory<\/td><td>Threads share memory<\/td><td>Processes have isolated memory<\/td><\/tr><tr><td>Speed<\/td><td>Faster (less overhead)<\/td><td>Slower due to process isolation<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"key-features-of-multithreading-in-java\">Key Features of Multithreading in Java<\/h3>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>Concurrency<\/strong>: Concurrent execution with multiple threads reduces idle CPU time.<\/li>\n\n\n\n<li><strong>Resource Sharing<\/strong>: The reason for threads being able to share the same memory space is that communication is efficient.<\/li>\n\n\n\n<li><strong>Independent Execution<\/strong>: Each thread runs independently, so failure in one thread doesn't affect others.<\/li>\n\n\n\n<li><strong>Synchronization Support<\/strong>: Java provides tools to manage thread interference and memory consistency.<\/li>\n<\/ol>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"creating-threads-in-java\">Creating Threads in Java<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"1-extending-the-thread-class\">1. Extending the <strong>Thread<\/strong> Class<\/h3>\n\n\n\n<p>In Java, you can create threads by extending the <strong>Thread<\/strong> class.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: java; title: ; notranslate\" title=\"\">\n\/\/ Define a thread by extending Thread\nclass MyThread extends Thread {\n    public void run() {\n        \/\/ Task to be performed by the thread\n        System.out.println(&quot;Thread is running: &quot; + Thread.currentThread().getName());\n    }\n}\n\npublic class ThreadExample {\n    public static void main(String&#x5B;] args) {\n        MyThread thread = new MyThread(); \/\/ Create a thread\n        thread.start(); \/\/ Start the thread\n    }\n}\n<\/pre><\/div>\n\n\n<p><strong>Explanation<\/strong>:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong><code>run()<\/code><\/strong><strong> Method<\/strong>: Contains the task the thread will execute.<\/li>\n\n\n\n<li><strong><code>start()<\/code><\/strong><strong> Method<\/strong>: Begins the thread execution by calling <code>run()<\/code> internally.<\/li>\n<\/ul>\n\n\n\n<p><strong>Suggested Read:<\/strong> <a href=\"https:\/\/www.mygreatlearning.com\/blog\/methods-in-java\/\">Methods in Java<\/a><\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"2-implementing-the-runnable-interface\">2. Implementing the <strong>Runnable<\/strong> Interface<\/h3>\n\n\n\n<p>If you want your class to extend another class (Java doesn\u2019t support multiple inheritance), you can use the <a href=\"https:\/\/www.mygreatlearning.com\/blog\/interface-in-java\/\">Runnable interface<\/a>.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: java; title: ; notranslate\" title=\"\">\nclass MyRunnable implements Runnable {\n    public void run() {\n        \/\/ Task for the thread\n        System.out.println(&quot;Runnable thread is running: &quot; + Thread.currentThread().getName());\n    }\n}\n\npublic class RunnableExample {\n    public static void main(String&#x5B;] args) {\n        Thread thread = new Thread(new MyRunnable()); \/\/ Pass Runnable to Thread\n        thread.start(); \/\/ Start the thread\n    }\n}\n<\/pre><\/div>\n\n\n<p><strong>Why use Runnable?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>It\u2019s more flexible and promotes code reusability.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"thread-lifecycle\"><strong>Thread Lifecycle<\/strong><\/h2>\n\n\n\n<p>Threads in Java go through the following states:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>New<\/strong>: Thread is created but not started.<\/li>\n\n\n\n<li><strong>Runnable<\/strong>: Thread is ready to run but waiting for the CPU.<\/li>\n\n\n\n<li><strong>Running<\/strong>: Thread is executing.<\/li>\n\n\n\n<li><strong>Waiting\/Blocked<\/strong>: Thread is waiting for resources or another thread.<\/li>\n\n\n\n<li><strong>Terminated<\/strong>: Thread has completed execution.<\/li>\n<\/ol>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"thread-synchronization\"><strong>Thread Synchronization<\/strong><\/h2>\n\n\n\n<p>When multiple threads access shared resources, synchronization ensures data consistency by allowing only one thread to access the resource at a time.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"example-synchronizing-a-counter\"><strong>Example: Synchronizing a Counter<\/strong><\/h3>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: java; title: ; notranslate\" title=\"\">\nclass Counter {\n    private int count = 0;\n\n    public synchronized void increment() {\n        count++; \/\/ Increment the count\n    }\n\n    public int getCount() {\n        return count;\n    }\n}\n\npublic class SynchronizationExample {\n    public static void main(String&#x5B;] args) throws InterruptedException {\n        Counter counter = new Counter();\n\n        Thread t1 = new Thread(() -&gt; {\n            for (int i = 0; i &lt; 1000; i++) {\n                counter.increment();\n            }\n        });\n\n        Thread t2 = new Thread(() -&gt; {\n            for (int i = 0; i &lt; 1000; i++) {\n                counter.increment();\n            }\n        });\n\n        t1.start();\n        t2.start();\n\n        t1.join(); \/\/ Wait for t1 to finish\n        t2.join(); \/\/ Wait for t2 to finish\n\n        System.out.println(&quot;Final count: &quot; + counter.getCount());\n    }\n}\n<\/pre><\/div>\n\n\n<p><strong>Explanation<\/strong>:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong><code>synchronized<\/code><\/strong><strong> Keyword<\/strong>: Ensures that only one thread can execute increment() at a time.<\/li>\n\n\n\n<li><strong><code>join()<\/code><\/strong><strong> Method<\/strong>: Waits for threads to complete before proceeding.<\/li>\n<\/ul>\n\n\n\n<p><strong>Suggested:<\/strong> Read in detail about <a href=\"https:\/\/www.mygreatlearning.com\/blog\/synchronization-in-java\/\">Synchronization in Java<\/a><\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"exception-handling-in-threads\"><strong>Exception Handling in Threads<\/strong><\/h2>\n\n\n\n<p>Threads may encounter exceptions, such as invalid input or divide-by-zero errors. Proper exception handling ensures stable execution.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"1-using-try-catch\">1. Using <strong>try-catch<\/strong><\/h3>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: java; title: ; notranslate\" title=\"\">\nclass ExceptionThread extends Thread {\n    public void run() {\n        try {\n            int result = 10 \/ 0; \/\/ Will throw ArithmeticException\n        } catch (ArithmeticException e) {\n            System.out.println(&quot;Exception handled: &quot; + e.getMessage());\n        }\n    }\n}\n\npublic class ExceptionHandlingExample {\n    public static void main(String&#x5B;] args) {\n        ExceptionThread thread = new ExceptionThread();\n        thread.start();\n    }\n}\n<\/pre><\/div>\n\n\n<h3 class=\"wp-block-heading\" id=\"2-using-uncaughtexceptionhandler\">2. Using <strong>UncaughtExceptionHandler<\/strong><\/h3>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: java; title: ; notranslate\" title=\"\">\nclass RiskyThread extends Thread {\n    public void run() {\n        int result = 10 \/ 0; \/\/ Throws exception\n    }\n}\n\npublic class UncaughtHandlerExample {\n    public static void main(String&#x5B;] args) {\n        Thread thread = new RiskyThread();\n        thread.setUncaughtExceptionHandler((t, e) -&gt; {\n            System.out.println(&quot;Exception in thread &quot; + t.getName() + &quot;: &quot; + e.getMessage());\n        });\n        thread.start();\n    }\n}\n<\/pre><\/div>\n\n\n<p><strong>Key Points<\/strong>:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>Try-catch<\/code> is for handling expected exceptions locally.<\/li>\n\n\n\n<li><code>UncaughtExceptionHandler<\/code> catches global exceptions in threads.<\/li>\n<\/ul>\n\n\n\n<p><strong>Suggested: <\/strong>Read in detail about <a href=\"https:\/\/www.mygreatlearning.com\/blog\/exception-handling-in-java\/\">Exception Handling in Java with Examples<\/a><\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"thread-pooling\">Thread Pooling<\/h2>\n\n\n\n<p>Thread pools reuse a fixed number of threads to execute multiple tasks, reducing the overhead of thread creation.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"example-using-executorservice\">Example Using <strong>ExecutorService<\/strong><\/h3>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: java; title: ; notranslate\" title=\"\">\nimport java.util.concurrent.ExecutorService;\nimport java.util.concurrent.Executors;\n\npublic class ThreadPoolExample {\n    public static void main(String&#x5B;] args) {\n        ExecutorService executor = Executors.newFixedThreadPool(3); \/\/ Pool size of 3\n\n        for (int i = 1; i &lt;= 5; i++) {\n            final int task = i;\n            executor.execute(() -&gt; {\n                System.out.println(&quot;Executing task &quot; + task + &quot; on thread: &quot; + Thread.currentThread().getName());\n            });\n        }\n\n        executor.shutdown(); \/\/ Shutdown the pool\n    }\n}\n<\/pre><\/div>\n\n\n<p><strong>Explanation<\/strong>:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>FixedThreadPool<\/strong>: Limits the number of threads running simultaneously.<\/li>\n\n\n\n<li>Efficient for handling large numbers of short-lived tasks.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"advanced-multithreading-concepts\">Advanced Multithreading Concepts<\/h2>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>Thread Priority<\/strong>: Threads can be assigned priorities <code>(MIN_PRIORITY, NORM_PRIORITY, MAX_PRIORITY)<\/code>.<\/li>\n\n\n\n<li><strong>Thread Group<\/strong>: Threads can be grouped and managed collectively.<\/li>\n\n\n\n<li><strong>Volatile Keyword<\/strong>: Ensures visibility of changes to a variable across threads.<\/li>\n<\/ol>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"multithreading-in-java-example\">Multithreading in Java Example<\/h2>\n\n\n\n<p>Here\u2019s an example of multithreading where threads perform different tasks concurrently.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: java; title: ; notranslate\" title=\"\">\n\/\/ Multithreading Example\nclass PrintNumbers implements Runnable {\n    @Override\n    public void run() {\n        for (int i = 1; i &lt;= 5; i++) {\n            System.out.println(&quot;Number: &quot; + i + &quot; by Thread: &quot; + Thread.currentThread().getId());\n        }\n    }\n}\n\nclass PrintAlphabets implements Runnable {\n    @Override\n    public void run() {\n        for (char c = &#039;A&#039;; c &lt;= &#039;E&#039;; c++) {\n            System.out.println(&quot;Alphabet: &quot; + c + &quot; by Thread: &quot; + Thread.currentThread().getId());\n        }\n    }\n}\n\npublic class Main {\n    public static void main(String&#x5B;] args) {\n        Thread t1 = new Thread(new PrintNumbers());\n        Thread t2 = new Thread(new PrintAlphabets());\n        t1.start(); \/\/ Start number printing thread\n        t2.start(); \/\/ Start alphabet printing thread\n    }\n}\n<\/pre><\/div>\n\n\n<h4 class=\"wp-block-heading\" id=\"output\"><strong>Output:<\/strong><\/h4>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nNumber: 1 by Thread: 13\nAlphabet: A by Thread: 14\nNumber: 2 by Thread: 13\nAlphabet: B by Thread: 14\n...\n<\/pre><\/div>\n\n\n<h2 class=\"wp-block-heading\" id=\"conclusion\">Conclusion<\/h2>\n\n\n\n<p>Multithreading in Java allows developers to write efficient, responsive, and scalable programs. From thread creation using <code>Thread<\/code> or <code>Runnable<\/code> to synchronization, exception handling, and thread pooling, Java provides robust APIs to manage concurrency.<\/p>\n\n\n\n<p>By mastering these concepts and applying them effectively, you can build powerful, multi-threaded applications.<\/p>\n\n\n\n<p><strong>Suggested Read:<\/strong> <a href=\"https:\/\/www.mygreatlearning.com\/blog\/java-stringbuilder\/\">Java StringBuilder Class: Methods, Examples and more<\/a><\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"faqs\">FAQs<\/h2>\n\n\n\n<p><strong>1. How does the Java Virtual Machine (JVM) handle threads?<\/strong><\/p>\n\n\n\n<p>The JVM uses the underlying operating system's threading model to manage threads. In most modern JVMs, threads are mapped to native OS threads, enabling efficient scheduling and execution. The JVM also manages thread priorities and provides a memory model to ensure safe interaction between threads.<\/p>\n\n\n\n<p><strong>2. Can multiple threads in Java access the same method at the same time?<\/strong><\/p>\n\n\n\n<p>Yes, multiple threads can access the same method unless the method is marked as <code>synchronized<\/code>. Without synchronization, threads may cause race conditions or inconsistent data. Synchronizing methods or blocks ensures only one thread can access the critical section at a time.<\/p>\n\n\n\n<p><strong>3. What is thread starvation, and how can it be avoided in Java?<\/strong><\/p>\n\n\n\n<p>Thread starvation occurs when a thread is unable to gain CPU time due to higher-priority threads monopolizing the processor. It can be avoided by:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Using <strong>fair locks<\/strong> (ReentrantLock with fairness policy).<\/li>\n\n\n\n<li>Avoiding excessive thread priority adjustments.<\/li>\n\n\n\n<li>Ensuring a balanced thread pool configuration in the application.<\/li>\n<\/ul>\n\n\n\n<p><strong>4. What is the difference between <\/strong><strong><code>wait()<\/code><\/strong><strong> and <\/strong><strong><code>sleep()<\/code><\/strong><strong> methods in Java multithreading?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>wait()<\/code>: Releases the monitor lock and suspends the thread until another thread calls <code>notify()<\/code> or <code>notifyAll()<\/code>. It is used for inter-thread communication.<\/li>\n\n\n\n<li><code>sleep()<\/code>: Pauses the thread for a specified time without releasing the lock. It is used for timing delays.<\/li>\n<\/ul>\n\n\n\n<p><strong>5. What is a deadlock in Java, and how can it be prevented?<\/strong><\/p>\n\n\n\n<p>A <strong>deadlock<\/strong> occurs when two or more threads are waiting indefinitely for each other to release locks, causing the program to freeze.<\/p>\n\n\n\n<p><strong>Prevention techniques<\/strong>:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Avoid nested locks.<\/li>\n\n\n\n<li>Use a consistent lock acquisition order.<\/li>\n\n\n\n<li>Use <code>tryLock()<\/code> from ReentrantLock to avoid indefinite blocking.<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Learn about Java Multithreading, its features, benefits, and how it enhances performance by allowing concurrent execution of threads.<\/p>\n","protected":false},"author":41,"featured_media":35641,"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":[36252],"class_list":["post-35562","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-software","tag-java","content_type-tutorials"],"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>Multithreading in Java - Step-by-step<\/title>\n<meta name=\"description\" content=\"Multithreading in Java refers to a process of executing two or more threads simultaneously for maximum utilization of the CPU.\" \/>\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\/multithreading-in-java\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Multithreading in Java: Step-by-Step\" \/>\n<meta property=\"og:description\" content=\"Multithreading in Java refers to a process of executing two or more threads simultaneously for maximum utilization of the CPU.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.mygreatlearning.com\/blog\/multithreading-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=\"2022-10-25T20:40:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-01-22T21:58:19+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2021\/06\/shutterstock_1386342911.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1000\" \/>\n\t<meta property=\"og:image:height\" content=\"615\" \/>\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=\"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\\\/multithreading-in-java\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/multithreading-in-java\\\/\"},\"author\":{\"name\":\"Great Learning Editorial Team\",\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/#\\\/schema\\\/person\\\/6f993d1be4c584a335951e836f2656ad\"},\"headline\":\"Multithreading in Java: Step-by-Step\",\"datePublished\":\"2022-10-25T20:40:00+00:00\",\"dateModified\":\"2025-01-22T21:58:19+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/multithreading-in-java\\\/\"},\"wordCount\":927,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/multithreading-in-java\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/wp-content\\\/uploads\\\/2021\\\/06\\\/shutterstock_1386342911.jpg\",\"keywords\":[\"java\"],\"articleSection\":[\"IT\\\/Software Development\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/multithreading-in-java\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/multithreading-in-java\\\/\",\"url\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/multithreading-in-java\\\/\",\"name\":\"Multithreading in Java - Step-by-step\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/multithreading-in-java\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/multithreading-in-java\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/wp-content\\\/uploads\\\/2021\\\/06\\\/shutterstock_1386342911.jpg\",\"datePublished\":\"2022-10-25T20:40:00+00:00\",\"dateModified\":\"2025-01-22T21:58:19+00:00\",\"description\":\"Multithreading in Java refers to a process of executing two or more threads simultaneously for maximum utilization of the CPU.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/multithreading-in-java\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/multithreading-in-java\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/multithreading-in-java\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/wp-content\\\/uploads\\\/2021\\\/06\\\/shutterstock_1386342911.jpg\",\"contentUrl\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/wp-content\\\/uploads\\\/2021\\\/06\\\/shutterstock_1386342911.jpg\",\"width\":1000,\"height\":615,\"caption\":\"Multithreading in Java\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/multithreading-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\":\"Multithreading in Java: Step-by-Step\"}]},{\"@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":"Multithreading in Java - Step-by-step","description":"Multithreading in Java refers to a process of executing two or more threads simultaneously for maximum utilization of the CPU.","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\/multithreading-in-java\/","og_locale":"en_US","og_type":"article","og_title":"Multithreading in Java: Step-by-Step","og_description":"Multithreading in Java refers to a process of executing two or more threads simultaneously for maximum utilization of the CPU.","og_url":"https:\/\/www.mygreatlearning.com\/blog\/multithreading-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":"2022-10-25T20:40:00+00:00","article_modified_time":"2025-01-22T21:58:19+00:00","og_image":[{"width":1000,"height":615,"url":"http:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2021\/06\/shutterstock_1386342911.jpg","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":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.mygreatlearning.com\/blog\/multithreading-in-java\/#article","isPartOf":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/multithreading-in-java\/"},"author":{"name":"Great Learning Editorial Team","@id":"https:\/\/www.mygreatlearning.com\/blog\/#\/schema\/person\/6f993d1be4c584a335951e836f2656ad"},"headline":"Multithreading in Java: Step-by-Step","datePublished":"2022-10-25T20:40:00+00:00","dateModified":"2025-01-22T21:58:19+00:00","mainEntityOfPage":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/multithreading-in-java\/"},"wordCount":927,"commentCount":0,"publisher":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/#organization"},"image":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/multithreading-in-java\/#primaryimage"},"thumbnailUrl":"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2021\/06\/shutterstock_1386342911.jpg","keywords":["java"],"articleSection":["IT\/Software Development"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.mygreatlearning.com\/blog\/multithreading-in-java\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.mygreatlearning.com\/blog\/multithreading-in-java\/","url":"https:\/\/www.mygreatlearning.com\/blog\/multithreading-in-java\/","name":"Multithreading in Java - Step-by-step","isPartOf":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/multithreading-in-java\/#primaryimage"},"image":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/multithreading-in-java\/#primaryimage"},"thumbnailUrl":"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2021\/06\/shutterstock_1386342911.jpg","datePublished":"2022-10-25T20:40:00+00:00","dateModified":"2025-01-22T21:58:19+00:00","description":"Multithreading in Java refers to a process of executing two or more threads simultaneously for maximum utilization of the CPU.","breadcrumb":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/multithreading-in-java\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.mygreatlearning.com\/blog\/multithreading-in-java\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.mygreatlearning.com\/blog\/multithreading-in-java\/#primaryimage","url":"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2021\/06\/shutterstock_1386342911.jpg","contentUrl":"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2021\/06\/shutterstock_1386342911.jpg","width":1000,"height":615,"caption":"Multithreading in Java"},{"@type":"BreadcrumbList","@id":"https:\/\/www.mygreatlearning.com\/blog\/multithreading-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":"Multithreading in Java: Step-by-Step"}]},{"@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\/06\/shutterstock_1386342911.jpg",1000,615,false],"thumbnail":["https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2021\/06\/shutterstock_1386342911-150x150.jpg",150,150,true],"medium":["https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2021\/06\/shutterstock_1386342911-300x185.jpg",300,185,true],"medium_large":["https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2021\/06\/shutterstock_1386342911-768x472.jpg",768,472,true],"large":["https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2021\/06\/shutterstock_1386342911.jpg",1000,615,false],"1536x1536":["https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2021\/06\/shutterstock_1386342911.jpg",1000,615,false],"2048x2048":["https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2021\/06\/shutterstock_1386342911.jpg",1000,615,false],"web-stories-poster-portrait":["https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2021\/06\/shutterstock_1386342911-640x615.jpg",640,615,true],"web-stories-publisher-logo":["https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2021\/06\/shutterstock_1386342911-96x96.jpg",96,96,true],"web-stories-thumbnail":["https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2021\/06\/shutterstock_1386342911-150x92.jpg",150,92,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":"Learn about Java Multithreading, its features, benefits, and how it enhances performance by allowing concurrent execution of threads.","_links":{"self":[{"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/posts\/35562","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=35562"}],"version-history":[{"count":34,"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/posts\/35562\/revisions"}],"predecessor-version":[{"id":112423,"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/posts\/35562\/revisions\/112423"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/media\/35641"}],"wp:attachment":[{"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/media?parent=35562"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/categories?post=35562"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/tags?post=35562"},{"taxonomy":"content_type","embeddable":true,"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/content_type?post=35562"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}