In this tutorial, we are going to write a Java program to use super keyword in Java Programming with practical program code and step-by-step full complete explanation.

Java program to use super keyword


Java program to use super keyword.

 
class Bike
{
    int speed=50;
}

class Super extends Bike
{
    int speed=100;

    void display()
    {
        System.out.println(super.speed);
    }

    public static void main(String args[])
    {
        Super b=new Super();
        b.display();
    }
}


Output

 
50