{"id":638,"date":"2021-06-21T12:43:41","date_gmt":"2021-06-21T12:43:41","guid":{"rendered":"https:\/\/rahulshettyacademy.com\/blog\/index.php\/2021\/06\/21\/set-interface-in-java\/"},"modified":"2021-06-21T12:43:41","modified_gmt":"2021-06-21T12:43:41","slug":"set-interface-in-java","status":"publish","type":"post","link":"https:\/\/rahulshettyacademy.com\/blog\/index.php\/2021\/06\/21\/set-interface-in-java\/","title":{"rendered":"Set Interface in Java"},"content":{"rendered":"<p><html><body><\/p>\n<section class=\"tcb-post-content tcb-shortcode thrv_wrapper\" data-css=\"tve-u-16ec5d248bb\">\n<div class=\"tve_flt tcb-style-wrap\" id=\"tve_flt\">\n<div class=\"tve_shortcode_editor tar-main-content\" data-post-id=\"638\" id=\"tve_editor\">\n<div class=\"thrv_wrapper tve-toc tve-elem-scroll tve-toc-expandable tcb-local-vars-root\" data-animation=\"fade\" data-animation-speed=\"fast\" data-bullet-style='{\"0\":\"tve-u-1739a1b9ec9\",\"1\":\"tve-u-1739a1ba9d6\",\"2\":\"tve-u-1739a1bb53c\"}' data-columns=\"1\" data-columns-d=\"1\" data-css=\"tve-u-17a2e90dc4a\" data-ct=\"toc-60672\" data-ct-name=\"Table of Contents 04\" data-element-name=\"Table of Contents\" data-headers=\"h1,h3,h5\" data-heading-style='{\"0\":\"tve-u-17a2e90dc51\",\"1\":\"tve-u-17a2e90dc53\",\"2\":\"tve-u-17a2e90dc54\"}' data-highlight=\"section\" data-number-style='{\"0\":\"tve-u-17a2e90dc52\",\"1\":\"tve-u-173dc88e09d\",\"2\":\"tve-u-173dc88e7b7\"}' data-numbering=\"basic\" data-state-default=\"expanded\" data-state-default-m=\"collapsed\" data-transition=\"slide\" style=\"\">\n<div class=\"thrive-colors-palette-config\" style=\"display: none !important\"><\/div>\n<div class=\"tve-toc-divider\" style=\"position: absolute; width: 0; height: 0; overflow: hidden;\">\n<div class=\"thrv_wrapper thrv-divider tve-vert-divider\" data-color-d=\"rgba(0, 0, 0, 0.24)\" data-css=\"tve-u-17a2e90dc4b\" data-style=\"tve_sep-1\" data-style-d=\"tve_sep-3\" data-thickness-d=\"6\">\n<hr class=\"tve_sep tve_sep-3\" style=\"\"\/><\/div>\n<\/div>\n<p><svg class=\"toc-icons\" style=\"position: absolute; width: 0; height: 0; overflow: hidden;\" version=\"1.1\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\"><symbol data-id=\"icon-clone-outlined\" id=\"toc-bullet-0\" viewbox=\"0 0 512 512\"><path d=\"M464 0H144c-26.51 0-48 21.49-48 48v48H48c-26.51 0-48 21.49-48 48v320c0 26.51 21.49 48 48 48h320c26.51 0 48-21.49 48-48v-48h48c26.51 0 48-21.49 48-48V48c0-26.51-21.49-48-48-48zM362 464H54a6 6 0 0 1-6-6V150a6 6 0 0 1 6-6h42v224c0 26.51 21.49 48 48 48h224v42a6 6 0 0 1-6 6zm96-96H150a6 6 0 0 1-6-6V54a6 6 0 0 1 6-6h308a6 6 0 0 1 6 6v308a6 6 0 0 1-6 6z\"><\/path><\/symbol><symbol data-id=\"icon-caret-right-solid\" id=\"toc-bullet-1\" viewbox=\"0 0 192 512\">\n<path d=\"M0 384.662V127.338c0-17.818 21.543-26.741 34.142-14.142l128.662 128.662c7.81 7.81 7.81 20.474 0 28.284L34.142 398.804C21.543 411.404 0 402.48 0 384.662z\"><\/path>\n<\/symbol><symbol data-id=\"icon-caret-right-solid\" id=\"toc-bullet-2\" viewbox=\"0 0 192 512\">\n<path d=\"M0 384.662V127.338c0-17.818 21.543-26.741 34.142-14.142l128.662 128.662c7.81 7.81 7.81 20.474 0 28.284L34.142 398.804C21.543 411.404 0 402.48 0 384.662z\"><\/path>\n<\/symbol><\/svg><\/p>\n<div class=\"tve-content-box-background\" data-css=\"tve-u-17a2e90dc4c\" style=\"\"><\/div>\n<div class=\"thrv_wrapper tve-toc-title show-icon reverse tcb-icon-display tve-no-dropzone tve-prevent-content-edit\" data-css=\"tve-u-17a2e90dc4d\" style=\"\">\n<div class=\"tve-content-box-background\"><\/div>\n<div class=\"tve-cb\" style=\"\">\n<div class=\"tve-toc-title-icon\" data-icon-code=\"icon-close-solid\" style=\"\"><svg class=\"tcb-icon\" data-id=\"icon-close-solid\" data-name=\"\" viewbox=\"0 0 24 24\"><path d=\"M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41Z\"><\/path><\/svg><\/div>\n<div class=\"thrv_wrapper thrv_text_element tve_no_icons\">\n<div class=\"tcb-plain-text\" data-css=\"tve-u-17a2e90dc4e\" style=\"\">table of contents<\/div>\n<\/p><\/div>\n<\/div>\n<\/div>\n<div class=\"tve-cb tve-toc-content tve-prevent-content-edit\">\n<div class=\"thrv_wrapper tve-toc-list tcb-no-delete tcb-no-save tcb-no-clone tve-no-dropzone\" data-css=\"tve-u-17a2e90dc4f\" style=\"\">\n<div class=\"tve-content-box-background\" data-css=\"tve-u-17a2e90dc50\"><\/div>\n<div class=\"tve-cb\">\n<div class=\"tve_ct_content tve_clearfix\">\n<div class=\"ct_column\">\n<div class=\"thrv_wrapper tve-toc-heading tve-toc-heading-level1 tve_no_icons\" data-css=\"tve-u-17a2e90dc53\" data-element-name=\"Heading Level 2\" data-tag=\"H3\"><a class=\"tve-toc-anchor tve-jump-scroll\" href=\"#t-1624278717056\" jump-animation=\"smooth\">What is Set interface?<\/a><\/div>\n<div class=\"thrv_wrapper tve-toc-heading tve-toc-heading-level1 tve_no_icons\" data-css=\"tve-u-17a2e90dc53\" data-element-name=\"Heading Level 2\" data-tag=\"H3\"><a class=\"tve-toc-anchor tve-jump-scroll\" href=\"#t-1624278717057\" jump-animation=\"smooth\">Describe different operations possible on a Set?<\/a><\/div>\n<div class=\"thrv_wrapper tve-toc-heading tve-toc-heading-level1 tve_no_icons\" data-css=\"tve-u-17a2e90dc53\" data-element-name=\"Heading Level 2\" data-tag=\"H3\"><a class=\"tve-toc-anchor tve-jump-scroll\" href=\"#t-1624278717058\" jump-animation=\"smooth\">How can we have an Ordered Set?<\/a><\/div>\n<div class=\"thrv_wrapper tve-toc-heading tve-toc-heading-level1 tve_no_icons\" data-css=\"tve-u-17a2e90dc53\" data-element-name=\"Heading Level 2\" data-tag=\"H3\"><a class=\"tve-toc-anchor tve-jump-scroll\" href=\"#t-1624278717059\" jump-animation=\"smooth\">How can we sort a Set?<\/a><\/div>\n<div class=\"thrv_wrapper tve-toc-heading tve-toc-heading-level1 tve_no_icons\" data-css=\"tve-u-17a2e90dc53\" data-element-name=\"Heading Level 2\" data-tag=\"H3\"><a class=\"tve-toc-anchor tve-jump-scroll\" href=\"#t-1624278717060\" jump-animation=\"smooth\">How to convert a Set to a List and vice versa?<\/a><\/div>\n<\/div>\n<div class=\"thrv_wrapper thrv-divider tve-vert-divider\" data-color-d=\"rgba(0, 0, 0, 0.24)\" data-css=\"tve-u-17a2e90dc4b\" data-style=\"tve_sep-1\" data-style-d=\"tve_sep-3\" data-thickness-d=\"6\">\n<hr class=\"tve_sep tve_sep-3\" style=\"\"\/><\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"thrv_wrapper thrv_text_element\">\n<h3 class=\"\">What is Set interface?<\/h3>\n<p>The set interface present in java.util package extends Collection interface. It is an unordered (Set does not maintain insertion order) collection which does not allow duplicates. <\/p>\n<p>Since Set does not allow duplicates, it is widely used in applications\/programs where we must avoid duplicates. <\/p>\n<p>When we want to create a Set, we cannot create object of it directly. We need to use any class which directly or indirectly implements Set. Hashset, LinkedHashSet &amp; TreeSet are the classes which can be used for creating a Set type collection.<\/p>\n<div class=\"code-block code-block-2\" style=\"margin: 8px auto; text-align: center; display: block; clear: both;\">\n<p><!-- horizontal responsive 2 --><br \/>\n<ins class=\"adsbygoogle\" data-ad-client=\"ca-pub-3231318496783163\" data-ad-format=\"auto\" data-ad-slot=\"2788468763\" data-full-width-responsive=\"true\" style=\"display:block\"><\/ins>\n<\/div>\n<p><strong>Example<\/strong><\/p>\n<\/div>\n<div class=\"thrv_wrapper thrv_contentbox_shortcode thrv-content-box tve-elem-default-pad\">\n<div class=\"tve-content-box-background\" style=\"background-image: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)) !important; background-size: auto !important; background-position: 50% 50% !important; background-attachment: scroll !important; background-repeat: no-repeat !important; --background-image:linear-gradient(rgba(0,0,0,0.5), rgba(0,0,0,0.5))  !important; --background-size:auto auto  !important; --background-position:50% 50%  !important; --background-attachment:scroll  !important; --background-repeat:no-repeat  !important;\"><\/div>\n<div class=\"tve-cb\">\n<div class=\"thrv_wrapper thrv_text_element\" data-css=\"tve-u-17a2e92b2de\" style=\"\">\n<p data-css=\"tve-u-17a2e92ff7e\" style=\"\">import java.util.HashSet;<br \/>import java.util.Set;<\/p>\n<p>public class Main {<\/p>\n<p>public static void main(String[] args) {<br \/>\/\/ Set demonstration using HashSet<br \/>Set&lt;String&gt; hash_Set = new HashSet&lt;&gt;();<\/p>\n<p>hash_Set.add(&#8220;program&#8221;);<br \/>hash_Set.add(&#8220;to&#8221;);<br \/>hash_Set.add(&#8220;demonstrate&#8221;);<br \/>hash_Set.add(&#8220;set&#8221;);<br \/>hash_Set.add(&#8220;set&#8221;);<\/p>\n<p>System.out.println(hash_Set);<br \/>}<\/p>\n<p>}<\/p>\n<p><span data-css=\"tve-u-17a2e931cd0\" style=\"color: rgb(0, 255, 0);\">Output<\/p>\n<p>[set, program, to, demonstrate]<\/span><\/p>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"thrv_wrapper thrv_text_element\">\n<p><strong>Explanation <br \/><\/strong><br \/>There are 2 things to observe in the above program. First, even if we have tried to insert a duplicate element, it was ignored by Set. Second, the order of insertion is not maintained while printing, which is another property of Set.<\/p>\n<h3 class=\"\">Describe different operations possible on a Set?<\/h3>\n<p>The following basic operations can be performed on a Set. <\/p>\n<p>\u2022Adding element \u2013 We can add new element to a set using add() method. Null is accepted as a value to be added in a Set.<\/p>\n<p>\u2022Remove an element \u2013 We can remove an element from a Set using remove() method.<\/p>\n<p>\u2022Verify presence \u2013 We can verify presence of an element in a Set using contains() method.<br \/>\u00a0<br \/>\u2022Iterate \u2013 We can iterate thru a Set using for-each loop or Iterator.<\/p>\n<p>Let\u2019s see the above operations with the help of a program.<\/p>\n<\/div>\n<div class=\"thrv_wrapper thrv_contentbox_shortcode thrv-content-box tve-elem-default-pad\">\n<div class=\"tve-content-box-background\" style=\"background-image: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)) !important; background-size: auto !important; background-position: 50% 50% !important; background-attachment: scroll !important; background-repeat: no-repeat !important; --background-image:linear-gradient(rgba(0,0,0,0.5), rgba(0,0,0,0.5))  !important; --background-size:auto auto  !important; --background-position:50% 50%  !important; --background-attachment:scroll  !important; --background-repeat:no-repeat  !important;\"><\/div>\n<div class=\"tve-cb\">\n<div class=\"thrv_wrapper thrv_text_element\" data-css=\"tve-u-17a2e95090a\" style=\"\">\n<p data-css=\"tve-u-17a2e953db4\" style=\"\">import java.util.HashSet;<br \/>import java.util.Iterator;<br \/>import java.util.Set;<\/p>\n<p>public class Main {<\/p>\n<p>public static void main(String[] args) {<br \/>Set&lt;String&gt; hash_Set = new HashSet&lt;&gt;();<\/p>\n<p>hash_Set.add(&#8220;program&#8221;);<br \/>hash_Set.add(&#8220;to&#8221;);<br \/>hash_Set.add(&#8220;demonstrate&#8221;);<br \/>hash_Set.add(&#8220;set&#8221;);<br \/>hash_Set.add(null);<br \/>System.out.println(hash_Set);<\/p>\n<p>\/\/ Remove an element<br \/>hash_Set.remove(null);<br \/>System.out.println(hash_Set);<br \/>\/\/ Verify presence of an element<br \/>System.out.println(hash_Set.contains(&#8220;program&#8221;));<\/p>\n<p>\/\/Iterate thru for each loop<\/p>\n<p>for (String s : hash_Set) {<br \/>System.out.print(s + &#8221; &#8220;);<br \/>}<br \/>System.out.println();<br \/>\/\/Iterate thru Iterator;<\/p>\n<p>Iterator&lt;String&gt; itr = hash_Set.iterator();<br \/>while (itr.hasNext()) {<br \/>System.out.print(itr.next() + &#8221; &#8220;);<br \/>}<br \/>}<\/p>\n<p>}<\/p>\n<p><span data-css=\"tve-u-17a2e955cff\" style=\"color: rgb(0, 255, 0);\">Output \u2013 <\/p>\n<p>[null, set, program, to, demonstrate]<br \/>[set, program, to, demonstrate]<br \/>true<br \/>set program to demonstrate <br \/>set program to demonstrate<\/span><\/p>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"thrv_wrapper thrv_text_element\">\n<h3 class=\"\">How can we have an Ordered Set?<\/h3>\n<p>We can use LinkedHashSet class to achieve this. LinkedHashSet extends Hashset class, so it inherits all properties of HashSet, but additionally offers ordering of element based on insertion sequence. <\/p>\n<p><strong>Example<\/strong><\/p>\n<\/div>\n<div class=\"thrv_wrapper thrv_contentbox_shortcode thrv-content-box tve-elem-default-pad\">\n<div class=\"tve-content-box-background\" style=\"background-image: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)) !important; background-size: auto !important; background-position: 50% 50% !important; background-attachment: scroll !important; background-repeat: no-repeat !important; --background-image:linear-gradient(rgba(0,0,0,0.5), rgba(0,0,0,0.5))  !important; --background-size:auto auto  !important; --background-position:50% 50%  !important; --background-attachment:scroll  !important; --background-repeat:no-repeat  !important;\"><\/div>\n<div class=\"tve-cb\">\n<div class=\"thrv_wrapper thrv_text_element\" data-css=\"tve-u-17a2e963a45\" style=\"\">\n<p data-css=\"tve-u-17a2e966788\" style=\"\">import java.util.LinkedHashSet;<br \/>import java.util.Set;<\/p>\n<p>public class Main {<\/p>\n<p>public static void main(String[] args) {<br \/>Set&lt;String&gt; linkedhashset = new LinkedHashSet&lt;&gt;();<\/p>\n<p>linkedhashset.add(&#8220;program&#8221;);<br \/>linkedhashset.add(&#8220;to&#8221;);<br \/>linkedhashset.add(&#8220;demonstrate&#8221;);<br \/>linkedhashset.add(&#8220;linked hash set&#8221;);<\/p>\n<p>System.out.println(linkedhashset);<\/p>\n<p>}<br \/>}<\/p>\n<p><span data-css=\"tve-u-17a2e967f92\" style=\"color: rgb(0, 255, 0);\">Output<\/p>\n<p>[program, to, demonstrate, linked hash set]<\/span><\/p>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"thrv_wrapper thrv_text_element\">\n<p><strong>Explanation<\/strong><\/p>\n<p>The insertion order is maintained while printing the values of the LinkedHashSet.<\/p>\n<h3 class=\"\">How can we sort a Set?<\/h3>\n<p>There is no direct support to sort elements in a Set. But we can use TreeSet class to achieve this. Let\u2019s see this in an example. <\/p>\n<p><strong>Example<\/strong><\/p>\n<\/div>\n<div class=\"thrv_wrapper thrv_contentbox_shortcode thrv-content-box tve-elem-default-pad\">\n<div class=\"tve-content-box-background\" style=\"background-image: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)) !important; background-size: auto !important; background-position: 50% 50% !important; background-attachment: scroll !important; background-repeat: no-repeat !important; --background-image:linear-gradient(rgba(0,0,0,0.5), rgba(0,0,0,0.5))  !important; --background-size:auto auto  !important; --background-position:50% 50%  !important; --background-attachment:scroll  !important; --background-repeat:no-repeat  !important;\"><\/div>\n<div class=\"tve-cb\">\n<div class=\"thrv_wrapper thrv_text_element\" data-css=\"tve-u-17a2e979ad2\" style=\"\">\n<p data-css=\"tve-u-17a2e97d1fc\" style=\"\">import java.util.Set;<br \/>import java.util.TreeSet;<\/p>\n<p>public class Main {<\/p>\n<p>public static void main(String[] args) {<br \/>Set&lt;String&gt; treeset = new TreeSet&lt;&gt;();<\/p>\n<p>treeset.add(&#8220;program&#8221;);<br \/>treeset.add(&#8220;to&#8221;);<br \/>treeset.add(&#8220;demonstrate&#8221;);<br \/>treeset.add(&#8220;tree set&#8221;);<\/p>\n<p>System.out.println(treeset);<\/p>\n<p>}<br \/>}<\/p>\n<p><span data-css=\"tve-u-17a2e97f69f\" style=\"color: rgb(0, 255, 0);\">Output<\/p>\n<p>[demonstrate, program, to, tree set]<\/span><\/p>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"thrv_wrapper thrv_text_element\">\n<p><strong>Explanation<br \/><\/strong><br \/>Even if the inserted words in the TreeSet are not in sorted manner, when we print the elements, they are printed in sorted manner.<\/p>\n<h3 class=\"\">How to convert a Set to a List and vice versa?<\/h3>\n<p>List to Set Example<\/p>\n<\/div>\n<div class=\"thrv_wrapper thrv_contentbox_shortcode thrv-content-box tve-elem-default-pad\">\n<div class=\"tve-content-box-background\" style=\"background-image: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)) !important; background-size: auto !important; background-position: 50% 50% !important; background-attachment: scroll !important; background-repeat: no-repeat !important; --background-image:linear-gradient(rgba(0,0,0,0.5), rgba(0,0,0,0.5))  !important; --background-size:auto auto  !important; --background-position:50% 50%  !important; --background-attachment:scroll  !important; --background-repeat:no-repeat  !important;\"><\/div>\n<div class=\"tve-cb\">\n<div class=\"thrv_wrapper thrv_text_element\" data-css=\"tve-u-17a2e98eeec\" style=\"\">\n<p data-css=\"tve-u-17a2e9913af\" style=\"\">public class Main {<\/p>\n<p>public static void main(String[] args) {<br \/>List&lt;String&gt; list = new ArrayList&lt;&gt;();<br \/>list.add(&#8220;Asia&#8221;);<br \/>list.add(&#8220;Asia&#8221;);<br \/>list.add(&#8220;Europe&#8221;);<br \/>list.add(&#8220;North America&#8221;);<\/p>\n<p>Set&lt;String&gt; set = new TreeSet&lt;&gt;();<br \/>set.addAll(list);<br \/>for (String s : set)<br \/>{<br \/>System.out.println(s);<br \/>}<\/p>\n<p>}<br \/>}<\/p>\n<p><span data-css=\"tve-u-17a2e9934d2\" style=\"color: rgb(0, 255, 0);\">Output<\/p>\n<p>Asia<br \/>Europe<br \/>North America<\/span><\/p>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"thrv_wrapper thrv_text_element\">\n<p><strong>Explanation<br \/><\/strong><br \/>First, we create a List and add few elements in it. Then we create a TreeSet and using addAll() method, we insert all elements of the List to the TreeSet and print the values in the console. <br \/>The important thing to observe here is, even though the List have a duplicate item, TreeSet did not allow that. So, we can remove the duplicates of List using this mechanism.<\/p>\n<p><strong>Set to List Example<\/strong><\/p>\n<\/div>\n<div class=\"thrv_wrapper thrv_contentbox_shortcode thrv-content-box tve-elem-default-pad\">\n<div class=\"tve-content-box-background\" style=\"background-image: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)) !important; background-size: auto !important; background-position: 50% 50% !important; background-attachment: scroll !important; background-repeat: no-repeat !important; --background-image:linear-gradient(rgba(0,0,0,0.5), rgba(0,0,0,0.5))  !important; --background-size:auto auto  !important; --background-position:50% 50%  !important; --background-attachment:scroll  !important; --background-repeat:no-repeat  !important;\"><\/div>\n<div class=\"tve-cb\">\n<div class=\"thrv_wrapper thrv_text_element\" data-css=\"tve-u-17a2e99b8f6\" style=\"\">\n<p data-css=\"tve-u-17a2e99fada\" style=\"\">import java.util.*;<\/p>\n<p>public class Main {<\/p>\n<p>public static void main(String[] args) {<br \/>Set&lt;String&gt; set = new HashSet&lt;&gt;();<br \/>set.add(&#8220;123&#8221;);<br \/>set.add(&#8220;456&#8221;);<br \/>set.add(&#8220;555&#8221;);<br \/>set.add(&#8220;421&#8221;);<\/p>\n<p>List&lt;String&gt; list = new ArrayList&lt;&gt;();<br \/>list.addAll(set);<br \/>for (String s : list)<br \/>{<br \/>System.out.println(s);<br \/>}<\/p>\n<p>}<br \/>}<\/p>\n<p><span data-css=\"tve-u-17a2e9a1ab0\" style=\"color: rgb(0, 255, 0);\">Output<\/p>\n<p>123<br \/>421<br \/>456<br \/>555<\/span><\/p>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"tcb_flag\" style=\"display: none\"><\/div>\n<\/section>\n<p><\/body><\/html><\/p>\n","protected":false},"excerpt":{"rendered":"<p>table of contents What is Set interface? Describe different operations possible on a Set? How can we have an Ordered Set? How can we sort a Set? How to convert a Set to a List and vice versa? What is Set interface? The set interface present in java.util package extends Collection interface. It is an [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[],"class_list":["post-638","post","type-post","status-publish","format-standard","hentry","category-java","post-wrapper","thrv_wrapper"],"_links":{"self":[{"href":"https:\/\/rahulshettyacademy.com\/blog\/index.php\/wp-json\/wp\/v2\/posts\/638","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/rahulshettyacademy.com\/blog\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/rahulshettyacademy.com\/blog\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/rahulshettyacademy.com\/blog\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/rahulshettyacademy.com\/blog\/index.php\/wp-json\/wp\/v2\/comments?post=638"}],"version-history":[{"count":0,"href":"https:\/\/rahulshettyacademy.com\/blog\/index.php\/wp-json\/wp\/v2\/posts\/638\/revisions"}],"wp:attachment":[{"href":"https:\/\/rahulshettyacademy.com\/blog\/index.php\/wp-json\/wp\/v2\/media?parent=638"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/rahulshettyacademy.com\/blog\/index.php\/wp-json\/wp\/v2\/categories?post=638"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/rahulshettyacademy.com\/blog\/index.php\/wp-json\/wp\/v2\/tags?post=638"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}