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: 
You have created an explicit constructor for your class. Any explicitly defined constructor will eliminate the default no-args constructor that Java will use implicitly.

Here is the constructor you have created:

```
CalCir(double r) {
    radius = r;}

```

In order to use inheritance as requested, you can do any of the following.

1. Remove the explicit constructor from the parent class.
2. Insert a second construction with no parameters into the parent class:

```
CalCir()
{
    // Set the radius to default of zero
    this(0);
}

```
3. Override the default constructor in the child class:

```
public class MainSubClass extends CalCir
{
    public MainSubClass()
    {
       // Set the radius to default of zero
       super(0);
    }

    public static void main(final String args[])
   {
    // Insert program here
   }
}

```
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
    }
}

```