I have a slight problem with my code below. I created a file and named it ClosedCurve.java and wrote all code into the file.
My code below wont be compiled. unless I add an access modifier public. and I do not understand why i need to do that.
package classs.and.objects;
public interface ClosedCurve {
double computeArea();
}
class Triangle implements ClosedCurve {
double computeArea() // I need to change to public double computeArea()
{
return 0.0;
}
}