| OK, I admit it, I'm stumped. I don't see what I'm doing wrong here.I've been staring at this stupid code for an hour and I don't get it.
I've got this abstract class:
public abstract class Shape {
// members
protected Point pos;
// abstract methods
public abstract void show();
// constructor: using coords
public Shape(double inX, double inY) {
move(inX, inY);
}
// constructor: using point
public Shape(Point inPoint) {
move(inPoint);
}
// move: using coords
public void move(double newX, double newY) {
pos = new Point(newX, newY);
}
// move: using point
public void move(Point inPoint) {
pos = inPoint;
}
}
That class compiles just fine. Then I try to compile this class, which you will notice extends Shape:
public class Line extends Shape {
// abstract methods
public void show() {
System.out.println("my line");
}
}
When I try to compile that I get this error:
Line.java:1: cannot resolve symbol
symbol : constructor Shape ()
location: class Shape
public class Line extends Shape {
^
1 error
WTH? (What the Heck?)
-Miko |