我有這條線在我的課:Java繼承找不到符號
public class Line extends Figure
,當我用這個命令編譯:
$ javac -cp :./stdlib.jar Line.java
,我得到這個錯誤:
Line.java:26: cannot find symbol
symbol : constructor Figure()
location: class Figure
public Line(double x0, double y0, double xn, double yn, Color initColor) {
-------------------------------------------------------------------------^
// the dashes above are supposed to be spaces, but I couldn't figure out how to format it correctly. The caret is actually there in that position
通常我會理解這個錯誤,但這次我不知道發生了什麼。我的Figure.java
文件位於與我的Line.java
相同的目錄中。