class CCirle
{
private double radius;
private static double pi = 3.1415926;
public CCirle(double r)
{
radius = r;
System.out.println("Customer Construktor of CCirle called");
}
public double getRadius()
{
return radius;
}
public double getArea()
{
return pi*radius*radius;
}
}
class CCoin extends CCirle
{
int Cent;
static int NumberofObjekts = 0;
public CCoin()
{
System.out.println("Customer Construktor of CCoin called");
}
}
public class Cirle
{
public static void main(String args[])
{
CCirle myFirstCirle = new CCirle(2.0);
System.out.println("Radius = "+ myFirstCirle.getRadius());
System.out.println("Area = "+ myFirstCirle.getArea());
}
}
Error Meldung:
...\Cirle\Cirle.java:45: CCirle(double) in CCirle cannot be applied to ()
{
^
1 error
CCirle(double) ist Konstruktor in Basis Class, in der abgeleitetern Class CCoin benutze ich Konstruktor ohne Parameter, wieso geht es nicht....
{
private double radius;
private static double pi = 3.1415926;
public CCirle(double r)
{
radius = r;
System.out.println("Customer Construktor of CCirle called");
}
public double getRadius()
{
return radius;
}
public double getArea()
{
return pi*radius*radius;
}
}
class CCoin extends CCirle
{
int Cent;
static int NumberofObjekts = 0;
public CCoin()
{
System.out.println("Customer Construktor of CCoin called");
}
}
public class Cirle
{
public static void main(String args[])
{
CCirle myFirstCirle = new CCirle(2.0);
System.out.println("Radius = "+ myFirstCirle.getRadius());
System.out.println("Area = "+ myFirstCirle.getArea());
}
}
Error Meldung:
...\Cirle\Cirle.java:45: CCirle(double) in CCirle cannot be applied to ()
{
^
1 error
CCirle(double) ist Konstruktor in Basis Class, in der abgeleitetern Class CCoin benutze ich Konstruktor ohne Parameter, wieso geht es nicht....