{"id":28857,"date":"2022-09-22T16:30:00","date_gmt":"2022-09-22T11:00:00","guid":{"rendered":"https:\/\/www.mygreatlearning.com\/blog\/generics-in-java\/"},"modified":"2025-07-28T16:06:26","modified_gmt":"2025-07-28T10:36:26","slug":"generics-in-java","status":"publish","type":"post","link":"https:\/\/www.mygreatlearning.com\/blog\/generics-in-java\/","title":{"rendered":"Generics In Java - Complete Guide"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\" id=\"what-are-generics-in-java\">What are Generics in Java?<\/h2>\n\n\n\n<p>Generics means using type parameters so that we can use a class, <a href=\"https:\/\/www.mygreatlearning.com\/blog\/interface-in-java\/\">interface<\/a> or <a href=\"https:\/\/www.mygreatlearning.com\/blog\/methods-in-java\/\">method<\/a> with different <a href=\"https:\/\/www.mygreatlearning.com\/blog\/data-types-in-java\/\">data types<\/a>.<\/p>\n\n\n\n<p>Simply put, suppose there is a \u201cplaceholder\u201d that represents a data type. When you create a class or call a method, you put the actual data type in place of the placeholder.<\/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=\"why-use-generics\">Why Use Generics?<\/h2>\n\n\n\n<p>There are three very important and useful benefits of using Generics in Java. Today\u2019s modern Java programming is based on this.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"type-checking-at-compile-time\">Type-Checking at Compile-Time<\/h3>\n\n\n\n<p>This is the biggest and most important benefit. Before Java 5, the compiler did not know what type of data was going inside a collection. This could lead to errors that only appeared at runtime.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n\/\/ Code before Java 5\nList list = new ArrayList();\nlist.add(&quot;hello&quot;); \/\/ String was inserted, no problem\nInteger i = (Integer) list.get(0); \/\/ This is a String, you are making an Integer, error occurred at runtime!\n\n<\/pre><\/div>\n\n\n<p>With generics, the Java compiler checks whether your code is written with the correct types. If you make a mistake, it will give an error before the code even runs, making bugs much easier to catch.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n\/\/ Modern Java with Generics\nList&amp;lt;String&gt; stringList = new ArrayList&amp;lt;&gt;();\nstringList.add(&quot;Valid&quot;);\n\n\/\/ The line below will give an error and the code will not run\n\/\/ stringList.add(new Integer(10));\n\n<\/pre><\/div>\n\n\n<h3 class=\"wp-block-heading\" id=\"no-hassle-of-casting\">No hassle of casting<\/h3>\n\n\n\n<p>Without generics, when we extract a value from a list, we have to do manual casting, which is both risky and messy.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n\/\/ Without Generics (casting required)\nList list = new ArrayList();\nlist.add(&quot;text&quot;);\nString s = (String) list.get(0); \/\/ Had to cast here\n\n\/\/ With Generics (clean code, no cast)\nList&amp;lt;String&gt; stringList = new ArrayList&amp;lt;&gt;();\nstringList.add(&quot;text&quot;);\nString s2 = stringList.get(0); \/\/ Got it straight away, no cast needed\n\n<\/pre><\/div>\n\n\n<p>Code becomes more clean, readable and safe.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"creating-generic-algorithms-is-easy\">Creating Generic Algorithms is easy<\/h3>\n\n\n\n<p>With the help of generics, you can create algorithms that can work with different data types, without breaking type safety. For example, Java\u2019s entire <a href=\"https:\/\/www.mygreatlearning.com\/blog\/collection-in-java\/\">Collections Framework<\/a> is built on generics.<\/p>\n\n\n\n<p>You can create a sort function that works with List&lt;Integer&gt;, List&lt;String&gt;, or any custom object, as long as it implements Comparable. This means the code is reusable, readable, and strongly typed.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"how-to-use-java-generics-syntax-and-examples\">How to use Java Generics: Syntax and examples<\/h2>\n\n\n\n<p>In Java, we can use Generics with class, interface, and method. For this, type parameters are defined using &lt; &gt; angle brackets.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"what-is-a-generic-class\">What is a Generic Class?<\/h3>\n\n\n\n<p>A generic class means a class that can hold any type of data, that is, we can make it flexible.<\/p>\n\n\n\n<p><strong>Syntax:<\/strong> A type parameter like &lt;T&gt; is added with the name of the class.<\/p>\n\n\n\n<p>In Java, capital letters are often used for these types:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>T = Type<\/li>\n\n\n\n<li>E = Element<\/li>\n\n\n\n<li>K = Key<\/li>\n\n\n\n<li>V = Value<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"example-a-generic-box-class\">Example: A Generic Box Class<\/h3>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\npublic class Box&amp;lt;T&gt; {\n    \/\/ T means &quot;Type&quot;\n    private T t;\n\n    public void set(T t) {\n        this.t = t;\n    }\n\n    public T get() {\n        return t;\n    }\n\n    public static void main(String&#x5B;] args) {\n        \/\/ Create a Box for Integer\n        Box&amp;lt;Integer&gt; integerBox = new Box&amp;lt;&gt;();\n        integerBox.set(10);\n        \/\/ integerBox.set(&quot;hello&quot;); \/\/ This will throw an error because the type is Integer\n\n        \/\/ Create a Box for String\n        Box&amp;lt;String&gt; stringBox = new Box&amp;lt;&gt;();\n        stringBox.set(&quot;Hello World&quot;);\n\n        System.out.println(&quot;Integer Value: &quot; + integerBox.get());\n        System.out.println(&quot;String Value: &quot; + stringBox.get());\n    }\n}\n\n<\/pre><\/div>\n\n\n<p><strong>What\u2019s happening here:<\/strong><\/p>\n\n\n\n<p>We created a Box&lt;T&gt; class that can store any type of data.<\/p>\n\n\n\n<p>Then we created Box&lt;Integer&gt; and Box&lt;String&gt; for different types.<\/p>\n\n\n\n<p>The Java compiler automatically checks whether the type is correct or not, this avoids runtime errors.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"what-is-a-generic-method\">What is a Generic Method?<\/h3>\n\n\n\n<p>Generic methods are methods where you define the type parameter yourself, whether the class is generic or not.<\/p>\n\n\n\n<p><strong>Syntax:<\/strong> The return type of a method is preceded by a declaration such as &lt;T&gt;.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"example-a-generic-utility-method\">Example: A Generic Utility Method<\/h3>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\npublic class Util {\n    \/\/ A generic static method\n    public static &amp;lt;T&gt; void printArray(T&#x5B;] inputArray) {\n        for (T element : inputArray) {\n            System.out.printf(&quot;%s &quot;, element);\n        }\n        System.out.println();\n    }\n\n    public static void main(String&#x5B;] args) {\n        Integer&#x5B;] intArray = { 1, 2, 3, 4, 5 };\n        String&#x5B;] stringArray = { &quot;A&quot;, &quot;B&quot;, &quot;C&quot; };\n\n        System.out.println(&quot;Integer Array contains:&quot;);\n        printArray(intArray); \/\/ Integer array passed\n\n        System.out.println(&quot;String Array contains:&quot;);\n        printArray(stringArray); \/\/ String array passed\n    }\n}\n\n<\/pre><\/div>\n\n\n<p><strong>What\u2019s worth learning:<\/strong> The printArray method can handle arrays of different types. That\u2019s the power of generics, the same code can work with multiple types.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"what-are-bounded-type-parameters\">What are Bounded Type Parameters?<\/h3>\n\n\n\n<p>We do use generics in Java, but sometimes we have to control which types are allowed. For example, if a method will compare, then we have to ensure that the object has the compareTo() method. This is what bounded type parameters do.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"use-of-upper-bound-through-extends-keyword\">Use of Upper Bound (through extends keyword)<\/h4>\n\n\n\n<p>If we want to guarantee that a type is Comparable (i.e. it has compareTo()), then we write it like this: &lt;T extends Comparable&lt;T&gt;&gt;. This means: T can be any type that is a child of Comparable.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"example-method-to-find-maximum-value\">Example: Method to find maximum value<\/h4>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\npublic class BoundedExample {\n    \/\/ This method will work only for types which are Comparable\n    public static &amp;lt;T extends Comparable&amp;lt;T&gt;&gt; T findMax(T a, T b) {\n        return (a.compareTo(b) &gt; 0) ? a : b;\n    }\n\n    public static void main(String&#x5B;] args) {\n        \/\/ Integer will work, because it is Comparable&amp;lt;Integer&gt;\n        System.out.println(&quot;Max of 3 and 7 is: &quot; + findMax(3, 7));\n\n        \/\/ String will also work, because it is Comparable&amp;lt;String&gt;\n        System.out.println(&quot;Max of &#039;apple&#039; and &#039;orange&#039; is: &quot; + findMax(&quot;apple&quot;, &quot;orange&quot;));\n\n        \/\/ This line will give an error because Object class is not Comparable\n        \/\/ findMax(new Object(), new Object());\n    }\n}\n\n<\/pre><\/div>\n\n\n<p><strong>Remember:<\/strong> If you want, you can apply multiple bounds as well, like: &lt;T extends Number &amp; Serializable&gt;. This means that T should be both Number and Serializable.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"generic-wildcards-and-subtyping-in-java\">Generic Wildcards and Subtyping (in Java)<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"what-is-wildcard\">What is Wildcard (?)?<\/h3>\n\n\n\n<p>When we create generic types in Java, sometimes we have to write code that can work with any type. In such a case, ? (question mark) is used, which is called a wildcard. It basically represents an unknown type. Its biggest advantage is that flexible and reusable APIs can be created from it.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"upper-bounded-wildcards-extends-type\">Upper Bounded Wildcards: ? extends Type<\/h3>\n\n\n\n<p><strong>What does it mean?<\/strong> It means, a type that is a subclass (or the same type itself) of the given type. Meaning: ? extends Number means, Number, Integer, Double, etc.<\/p>\n\n\n\n<p><strong>When to use?<\/strong> When you just want to read the data, you use extends.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"example-a-method-that-takes-a-list-of-any-kind-of-numbers-integer-double-etc-and-finds-their-total\">Example: A method that takes a list of any kind of numbers (Integer, Double, etc.) and finds their total.<\/h4>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\npublic static double sumOfList(List&amp;lt;? extends Number&gt; list) {\n    double sum = 0.0;\n    for (Number n : list) {\n        sum += n.doubleValue(); \/\/ We can read safely\n    }\n    \/\/ list.add(new Integer(5)); \/\/ Error: We cannot add anything\n    return sum;\n}\n\n<\/pre><\/div>\n\n\n<p><strong>Note:<\/strong> You cannot add anything to List&lt;? extends Number&gt;, because Java does not know what the actual type of list is, Integer, Double or something else.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"lower-bounded-wildcards-super-type\">Lower Bounded Wildcards: ? super Type<\/h3>\n\n\n\n<p><strong>What does it mean?<\/strong> It means, a type that is the superclass of the given type. Meaning: ? super Integer can be anything like Integer, Number, or Object.<\/p>\n\n\n\n<p><strong>When to use?<\/strong> You use super when you want to add (write) data.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"example-a-method-that-can-add-integer-values-to-any-compatible-list\">Example: A method that can add Integer values to any compatible list.<\/h4>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\npublic static void addIntegers(List&amp;lt;? super Integer&gt; list) {\n    list.add(1);\n    list.add(2);\n    list.add(3);\n    \/\/ Object obj = list.get(0); \/\/ We can only read as Object\n}\n\n<\/pre><\/div>\n\n\n<p><strong>Note:<\/strong> You can safely add Integer because it is a subclass of both Number and Object.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"tip-remember-the-pecs\">Tip: Remember the PECS!<\/h3>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>Shortcut<\/th><th>Meaning<\/th><\/tr><\/thead><tbody><tr><td>Producer<\/td><td>Extends<\/td><\/tr><tr><td>Consumer<\/td><td>Super<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>If you are reading from the list (producer), use extends. If you are writing in the list (consumer), use super.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" class=\"wp-block-heading\" id=\"advanced-concept-type-erasure-how-do-java-generics-work\">Advanced Concept: Type Erasure - How do Java Generics work?<\/h2>\n\n\n\n<p>When we use generics in Java, such as <code>List&lt;String&gt;<\/code> or <code>Box&lt;T&gt;<\/code>, they are used only at compile time, that is, to make the code type safe. But when the code runs (at runtime), Java removes these generic types. This process is called <strong>Type Erasure<\/strong>.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"how-type-erasure-works\">How Type Erasure Works?<\/h3>\n\n\n\n<p>When Java code is compiled, the compiler checks the generic types to see if you have used the correct type or not. But after compilation, all this generic information is removed.<\/p>\n\n\n\n<p>Generic types are either replaced by their bound (if there is any bound) or if there is no bound, it is replaced by Object. The compiler also adds type casting as needed so that type safety is maintained.<\/p>\n\n\n\n<p>This means that both <code>List&lt;String&gt;<\/code> and <code>List&lt;Integer&gt;<\/code> are created the same at runtime a simple raw <code>List<\/code>.<\/p>\n\n\n\n<p>Java did this so that old code written before Java 5 can still work in today\u2019s time without breaking (this is called backward compatibility).<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" class=\"wp-block-heading\" id=\"limitations-of-type-erasure\">Limitations of Type Erasure<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Primitive types cannot be used in direct generics:<\/strong> For example, <code>List&lt;int><\/code> will not work, instead you will have to write <code>List&lt;Integer><\/code>.<\/li>\n\n\n\n<li><strong>Cannot create a new object of Generic type:<\/strong> Cannot write <code>new T()<\/code> because the actual type of <code>T<\/code> is not known at runtime.<\/li>\n\n\n\n<li><strong>Cannot keep Generic types in static fields:<\/strong> For example, <code>static T value;<\/code> this is not valid.<\/li>\n\n\n\n<li><strong>Instanceof check does not work with generic:<\/strong> For example, <code>list instanceof List&lt;String><\/code> is false because <code>&lt;String><\/code> does not exist at runtime.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" class=\"wp-block-heading\" id=\"faqs-frequently-asked-questions\">FAQs - Frequently Asked Questions<\/h2>\n\n\n\n<h4 class=\"wp-block-heading\" class=\"wp-block-heading\" id=\"q-what-is-diamond-operator\">Q: What is Diamond Operator (&lt;&gt;)?<\/h4>\n\n\n\n<p>The Diamond Operator was introduced in Java 7. This makes the code smaller and cleaner. Java automatically understands what type of object to create.<\/p>\n\n\n\n<p>Earlier we used to write like this:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nBox&amp;lt;Integer&gt; integerBox = new Box&amp;lt;Integer&gt;();\n<\/pre><\/div>\n\n\n<p>Now we can write like this:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nBox&amp;lt;Integer&gt; integerBox = new Box&amp;lt;&gt;();\n<\/pre><\/div>\n\n\n<h4 class=\"wp-block-heading\" class=\"wp-block-heading\" id=\"q-can-a-class-have-more-than-one-type-parameter\">Q: Can a class have more than one type parameter?<\/h4>\n\n\n\n<p>Yes, it can. This happens many times in Java. The most common example is:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nMap&amp;lt;K, V&gt;\n<\/pre><\/div>\n\n\n<p>Where <code>K<\/code> means the type of Key and <code>V<\/code> means the type of Value.<\/p>\n\n\n\n<p>For example:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nMap&amp;lt;String, Integer&gt; wordCounts = new HashMap&amp;lt;&gt;();\n<\/pre><\/div>\n\n\n<h4 class=\"wp-block-heading\" class=\"wp-block-heading\" id=\"q-why-cant-we-create-an-array-of-generic-type-by-calling-new-t10\">Q: Why can't we create an array of generic type by calling new T[10]?<\/h4>\n\n\n\n<p>The reason for this is also Type Erasure. In Java, the type of <code>T<\/code> disappears at runtime, so JVM doesn't know what type of array to create.<\/p>\n\n\n\n<p>The workaround is:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Create an <code>Object[]<\/code> and cast it<\/li>\n\n\n\n<li>Or pass a <code>Class&lt;T><\/code> in the constructor so that it can recognize the type<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>In this guide, we will cover Java Generics in great detail, starting with basic concepts and moving on to advanced topics like wildcards and type erasure.<\/p>\n<p>Each concept will be explained with practical code examples to make sure not only the theory but also the real-world usage is clear.<\/p>\n","protected":false},"author":41,"featured_media":28877,"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-28857","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>Generics In Java \u2013 Complete Guide<\/title>\n<meta name=\"description\" content=\"The generics in java programming was introduced in J2SE 5 to deal with type-safe objects. It detects the bugs at compile-time and makes the code stable.\" \/>\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\/generics-in-java\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Generics In Java - Complete Guide\" \/>\n<meta property=\"og:description\" content=\"The generics in java programming was introduced in J2SE 5 to deal with type-safe objects. It detects the bugs at compile-time and makes the code stable.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.mygreatlearning.com\/blog\/generics-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-09-22T11:00:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-07-28T10:36:26+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2021\/03\/iStock-1148960878-1.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1192\" \/>\n\t<meta property=\"og:image:height\" content=\"880\" \/>\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\\\/generics-in-java\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/generics-in-java\\\/\"},\"author\":{\"name\":\"Great Learning Editorial Team\",\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/#\\\/schema\\\/person\\\/6f993d1be4c584a335951e836f2656ad\"},\"headline\":\"Generics In Java - Complete Guide\",\"datePublished\":\"2022-09-22T11:00:00+00:00\",\"dateModified\":\"2025-07-28T10:36:26+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/generics-in-java\\\/\"},\"wordCount\":1261,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/generics-in-java\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/wp-content\\\/uploads\\\/2021\\\/03\\\/iStock-1148960878-1.jpg\",\"keywords\":[\"java\"],\"articleSection\":[\"IT\\\/Software Development\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/generics-in-java\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/generics-in-java\\\/\",\"url\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/generics-in-java\\\/\",\"name\":\"Generics In Java \u2013 Complete Guide\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/generics-in-java\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/generics-in-java\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/wp-content\\\/uploads\\\/2021\\\/03\\\/iStock-1148960878-1.jpg\",\"datePublished\":\"2022-09-22T11:00:00+00:00\",\"dateModified\":\"2025-07-28T10:36:26+00:00\",\"description\":\"The generics in java programming was introduced in J2SE 5 to deal with type-safe objects. It detects the bugs at compile-time and makes the code stable.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/generics-in-java\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/generics-in-java\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/generics-in-java\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/wp-content\\\/uploads\\\/2021\\\/03\\\/iStock-1148960878-1.jpg\",\"contentUrl\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/wp-content\\\/uploads\\\/2021\\\/03\\\/iStock-1148960878-1.jpg\",\"width\":1192,\"height\":880,\"caption\":\"generics in java\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/generics-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\":\"Generics In Java &#8211; Complete Guide\"}]},{\"@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":"Generics In Java \u2013 Complete Guide","description":"The generics in java programming was introduced in J2SE 5 to deal with type-safe objects. It detects the bugs at compile-time and makes the code stable.","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\/generics-in-java\/","og_locale":"en_US","og_type":"article","og_title":"Generics In Java - Complete Guide","og_description":"The generics in java programming was introduced in J2SE 5 to deal with type-safe objects. It detects the bugs at compile-time and makes the code stable.","og_url":"https:\/\/www.mygreatlearning.com\/blog\/generics-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-09-22T11:00:00+00:00","article_modified_time":"2025-07-28T10:36:26+00:00","og_image":[{"width":1192,"height":880,"url":"http:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2021\/03\/iStock-1148960878-1.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":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.mygreatlearning.com\/blog\/generics-in-java\/#article","isPartOf":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/generics-in-java\/"},"author":{"name":"Great Learning Editorial Team","@id":"https:\/\/www.mygreatlearning.com\/blog\/#\/schema\/person\/6f993d1be4c584a335951e836f2656ad"},"headline":"Generics In Java - Complete Guide","datePublished":"2022-09-22T11:00:00+00:00","dateModified":"2025-07-28T10:36:26+00:00","mainEntityOfPage":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/generics-in-java\/"},"wordCount":1261,"commentCount":0,"publisher":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/#organization"},"image":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/generics-in-java\/#primaryimage"},"thumbnailUrl":"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2021\/03\/iStock-1148960878-1.jpg","keywords":["java"],"articleSection":["IT\/Software Development"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.mygreatlearning.com\/blog\/generics-in-java\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.mygreatlearning.com\/blog\/generics-in-java\/","url":"https:\/\/www.mygreatlearning.com\/blog\/generics-in-java\/","name":"Generics In Java \u2013 Complete Guide","isPartOf":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/generics-in-java\/#primaryimage"},"image":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/generics-in-java\/#primaryimage"},"thumbnailUrl":"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2021\/03\/iStock-1148960878-1.jpg","datePublished":"2022-09-22T11:00:00+00:00","dateModified":"2025-07-28T10:36:26+00:00","description":"The generics in java programming was introduced in J2SE 5 to deal with type-safe objects. It detects the bugs at compile-time and makes the code stable.","breadcrumb":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/generics-in-java\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.mygreatlearning.com\/blog\/generics-in-java\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.mygreatlearning.com\/blog\/generics-in-java\/#primaryimage","url":"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2021\/03\/iStock-1148960878-1.jpg","contentUrl":"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2021\/03\/iStock-1148960878-1.jpg","width":1192,"height":880,"caption":"generics in java"},{"@type":"BreadcrumbList","@id":"https:\/\/www.mygreatlearning.com\/blog\/generics-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":"Generics In Java &#8211; Complete Guide"}]},{"@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\/03\/iStock-1148960878-1.jpg",1192,880,false],"thumbnail":["https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2021\/03\/iStock-1148960878-1-150x150.jpg",150,150,true],"medium":["https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2021\/03\/iStock-1148960878-1-300x221.jpg",300,221,true],"medium_large":["https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2021\/03\/iStock-1148960878-1-768x567.jpg",768,567,true],"large":["https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2021\/03\/iStock-1148960878-1-1024x756.jpg",1024,756,true],"1536x1536":["https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2021\/03\/iStock-1148960878-1.jpg",1192,880,false],"2048x2048":["https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2021\/03\/iStock-1148960878-1.jpg",1192,880,false],"web-stories-poster-portrait":["https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2021\/03\/iStock-1148960878-1-640x853.jpg",640,853,true],"web-stories-publisher-logo":["https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2021\/03\/iStock-1148960878-1-96x96.jpg",96,96,true],"web-stories-thumbnail":["https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2021\/03\/iStock-1148960878-1-150x111.jpg",150,111,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":"In this guide, we will cover Java Generics in great detail, starting with basic concepts and moving on to advanced topics like wildcards and type erasure. Each concept will be explained with practical code examples to make sure not only the theory but also the real-world usage is clear.","_links":{"self":[{"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/posts\/28857","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=28857"}],"version-history":[{"count":31,"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/posts\/28857\/revisions"}],"predecessor-version":[{"id":110426,"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/posts\/28857\/revisions\/110426"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/media\/28877"}],"wp:attachment":[{"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/media?parent=28857"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/categories?post=28857"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/tags?post=28857"},{"taxonomy":"content_type","embeddable":true,"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/content_type?post=28857"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}