Java Program using super keyword with arguments


In this program, You will learn how to implement super keyword with arguments in Java.


System.out.println(super.x, super.y);


Example: How to implement super keyword with arguments in Java

Run it Now
class First {
    int x = 10,y=11;
    void print(int a, int b) {
        System.out.println("The value is :" + (a+b));
    }
}

class Main extends First {

    int x = 33,y=66;
    void display() {
        print(super.x, super.y);
    }

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

Output:

The value is :21