Introduction - If you have any usage issues, please Google them yourself
Run the following procedure to use the super keyword analysis, as well as the parent class and subclass relationship between the hidden and rewriting class superClass {int x superClass () {x = 3 System.out.println (" in superClass: x = " +x) } void doSomething () {System.out.println (" in superClass.doSomething () " ) }} class subClass extends superClass {int x subClass () {super () // call constructor of superClass x = 5 System.out.println (" in subClass: x =" +x) } void doSomething () {super.doSomething () // call method of superClass System.out.println (" in subClass.doSomething () " ) // call x of superClass System.out.println (" super.x = " +super.x+" sub.x = " +x) }} public class inheritance {public static void main (String args [] ) {subClass subC = new subClass () subC.doSomething ()