Java Program using parameterized constructor with abstract class


In this program, You will learn how to implement parameterized constructor with abstract class in Java.


abstract class First { First (int x) { } }


Example: How to implement parameterized constructor with abstract class in Java

Run it Now
abstract class First {
    First(int x) {
        System.out.println("Parameterized Constructor value is :" + x);
    }
}

class Main extends First {

    Main(int x) {
        super(x);
    }

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

Output:

Parameterized Constructor value is :20