Java Program using the parameterized constructor with an abstract class


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


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

Example: How to implement parameterized constructor with abstract class in java.

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