JAVA分析 (高分)

来源:百度知道 编辑:UC知道 时间:2024/05/04 07:16:36
不知道类怎么用?lol, Novice, I am.
class TryGeometry
{
public static void main(String[] args)
{
Point start=new Point(0.0, 1.0);
Point end=new Point(5.0, 6.0);
System.out.println("points created are "+start+"and"+end);

Line line1=new Line(start, end);
Line line2=new Line(0.0, 3.0, 3.0, 0.0);
System.out.println("Lines created are "+line1+"and"+line2);

System.out.println("Intersection is "+line2.intersects(line1));

end.nove(1.0, -5.0);
System.out.println("Intersection is "+line1.intersects(line2));
}
}

end.nove改为end.move

我的jdk1.6编译时出错。

可能的原因:

Line类 以及 Point类的nove方法 可能是jdk最新版本中增加的东西。

Line 是一个接口,他表示单声道或多声道音频供给,你这里应该用Line2D.Float这个类,它表示画直线