{"id":3788,"date":"2014-03-30T05:37:26","date_gmt":"2014-03-30T05:37:26","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/03\/30\/reflection-api-find-subclass-type-collection-of-common-programming-errors\/"},"modified":"2014-03-30T05:37:26","modified_gmt":"2014-03-30T05:37:26","slug":"reflection-api-find-subclass-type-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2014\/03\/30\/reflection-api-find-subclass-type-collection-of-common-programming-errors\/","title":{"rendered":"Reflection api &#8211; find subclass type-Collection of common programming errors"},"content":{"rendered":"<p>Hi I am trying to find out the subclass, form an superclass object.<\/p>\n<pre><code>if Class Super is the super class.\nand Class Sub1 and Class Sub2 extends Class Super.(all classes are public)\n\nLets say I have a object of Super type as\nSuper superObject = new Sub1();\n<\/code><\/pre>\n<p>now for the superObject, <strong>is it possible<\/strong> to find which subclass the superObject extends in Java?<\/p>\n<p><em>Since &#8220;SuperClass will not be aware of any SubClasses it has&#8221;, can you please tell me is my above question <strong>valid<\/strong> in the first place, or am I missing any basic concept?<\/em><\/p>\n<p>Thanks in advance.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Hi I am trying to find out the subclass, form an superclass object. if Class Super is the super class. and Class Sub1 and Class Sub2 extends Class Super.(all classes are public) Lets say I have a object of Super type as Super superObject = new Sub1(); now for the superObject, is it possible to [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-3788","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/3788","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=3788"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/3788\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=3788"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=3788"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=3788"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}