In Java, the super keyword is used to access variables and methods of a super class from a sub class. For example:
public class Super { protected int number; protected showNumber() { System.out.println("number = " + number); } } public class Sub extends Super { void bar() { super.number = 10; super.showNumber(); } }
In the above example, the class Sub accesses the variable number and calls the method showNumber() for its super class Super.
Related keyword: this. See all keywords in Java.