Where is super defined? [When we use super.someMethod ()]. Is this a field in the java.lang.Object class or the java.lang.Class class?
When we call from a subclass, super contains a reference to the superclass. Similarly, the super in the superclass has a link to the superclass [Thus, prior to java.lang.Object]. So, how does java enter superclass references in the "super" field, which allows us to call superclass methods?
Are there any options for implementing the hood, such as:
Class current = this.getClass(); Class parent = current.getSuperclass(); System.out.println("name is =" + parent);
java inheritance super jvm superclass
Debadyuti maiti
source share