Say I have the following two classes:
package MyShape;
public abstract class Shapeclass {
public abstract double area(double radius);
protected void print(double area) {
System.out.print("Area is:" + area);
}
}
And another class, Triangle;
package MyShape;
public class Triangle extends Shapeclass {
double area;
public double area(double radius) {
return radius * radius;
}
public void print() {
super.print(area);
}
}
I have put both classes in the same folder named MyShape. But when I try to compile the Triangle class compiler, it shows the following error;
C:\Users\Desktop\MyShape\Triangle.java:3: error: cannot find symbol
public class Triangle extends Shapeclass
^
symbol: class Shapeclass
C:\Users\Desktop\MyShape\Triangle.java:13: error: cannot find symbol
super.print(area);
^
symbol: variable super
location: class Triangle
How can I solve it?
Triangle.java?