Question: I am having difficulty extending the calCir class to the main class 
I have a constructor that gives 

```
class calCir {
    double radius;
    calCir(double r) {
        radius = r;
    }

    double AreaCircle() {
        return Math.PI * (radius * radius);
    }
    double CircumferenceCircle() {
        return 2 * Math.PI * radius;
    }
}

```

I would like to use Main extends calCir but get an error due to the constructor

```
class Main{
public static void main(String args[]) {

```

error: constructor calCir in class calCir cannot be applied to given types;
class Main extends calCir
Im fairly new to Java so im still confused as to how I would use inheritance

Here is the full code if needed
<https://repl.it/NA5S/8>

Answer: 
This error is due to following reason:

when you create a constructor for a class, there won't be any default constructor created for that class. so if you extend that class and if the subclass tries to call the no-arg constructor of its super class then there will be an compile-time error.

As stated here: [Constructor in class cannot be applied to given types](https://stackoverflow.com/questions/19788963/constructor-in-class-cannot-be-applied-to-given-types)
First, it is meaningless to have `Main` extend `CalCir` in this case.

Second, go back to the specific question you asked.

When you have a class (e.g. `Child`) extend from another (e.g. `Parent`), in the ctor of `Child`, it ALWAYS needs to invoke constructor of its parent. If you are not EXPLICITLY invoking any, compiler will automatically assume you are invoking the no-arg constructor of parent.

e.g. 

```
class Child extends Parent {
    Child() {
        // do something
    }
}

```

is equivalent to 

```
class Child extends Parent {
    Child() {
        super();
        // do something
    }
}

```

If in `Parent`, a constructor with arguments is declared, but there is no-arg ctor declared:

```
class Parent {
     Parent(int foo) {...}
}

```

it is illegal for `Child` to invoke the no-arg ctor of `Parent`, because it simply does not exists.

So you need to explicitly tell the compiler which ctor you want to invoke:

```
class Child extends Parent {
    Child() {
        super(123);
        // do something
    }
}

```