私はのクラスLine
と適合コンストラクタを持っています。
私は定義しました:
Line l1 = new Line("A", "B");
ts
メンバーを持つクラスがあります:Vector<Line> allLines = new Vector<Line>();
このベクトルに線を追加したいl1
..
次の 3 つのオプションを試しましたが、うまくいきません。
ts.allLines.addElement(l1);
しかし、私はエラーが発生しました:
The method addElement(Line) in the type Vector<Line> is not applicable for the arguments (Line)
ts.allLines.add(l1);
しかし、私は得ました:
The method add(Line) in the type Vector<Line> is not applicable for the arguments (Line)
しかし、うまくいきません。