Site icon

Java super Keyword with Example


In this tutorial, we will learn about the super keyword in Java. In the previous post, we learned about this keyword.

super is a reference variable that points to the superclass object. We can use this keyword in a subclass to refer to the parent methods, variables, and constructors.


package staff;

// Constructor
public class SalaryEmployee extends Staff {
	private double empSalary;

	public SalaryEmployee(String name, String address,double salary) {
		super(name, address);
		this.empSalary = salary;


Notice how we have invoked the Parent class constructor using the super keyword.

super(name, address);

Java Tutorial on this website:

For more information on Java, visit the official website :

Exit mobile version