import java.util.Scanner;
class A
{
    int x;
    A(int x)
    {
        this.x=x;
    }
    void callme()
    {
        System.out.println("Number in A: "+x);
    }
}
class B extends A
{
    B(int x)
    {
        super(x+100);
    }
    void callme()
    {
       System.out.println("Number in B: "+x); 
    }
}
class C extends A
{
    C(int x)
    {
        super(x+200);
    }
    void callme()
    {
        System.out.println("Number in C: "+x);
    }
}
class DynamicMethod
{
    public static void main(String[] args)
    {
        Scanner sc=new Scanner(System.in);
        int x=sc.nextInt();
        int y=sc.nextInt();
        int z=sc.nextInt();
        A a1=new A(x);
        B b1=new B(y);
        C c1=new C(z);
        a1.callme();
        b1.callme();
        c1.callme();
    }
}

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: