when to use super in java code example
Example: super keyword in java
// example on super keyword in java
class Manager
{
int salary = 50000;
}
class Employee extends Manager
{
int salary = 20000;
void display(int salary)
{
// here refers to the parent class instance variable
System.out.println(super.salary);
}
public static void main(String[] args)
{
Employee obj = new Employee();
obj.display(30000);
}
}