So my goal is to use inheritance and as you can see I inherited Point Example which has x, y as variables. Well for some odd reason my Length seems to be in correct and I'm not sure where I went wrong. Any guidance will be very much appreciated.
Just updated the code and found some more errors that I just fixed... now there are warnings that won't allow me to run the program?...
class PointExample {
private double x;
private double y;
public PointExample(double a, double b) {
x = a;
y = b;
}
}
class Length extends PointExample {
private double middleLength;
private double leftLength;
private double rightLength;
public Length(double a, double b, double c) {
super(a,b);
leftLength = a;
middleLength = b;
rightLength = c;
}
public class InheritanceTest {
public void main(String args[]) {
Length a = new Length(14, 9, 15);
double overallMiddle = rightLength - middleLength;
System.out.println("The right length - the middle length = " + overallMiddle);
}
}
}
Error received
http://i42.tinypic.com/e12cqo.png