|

楼主 |
发表于 2003-7-21 21:49
|
显示全部楼层
不好意思,我又回来了...
public class RectangleDemo
{
public static void main(String args[])
{
Point p1;
Rectangle r1 = new Rectangle(p1,40,30);
r1.move(50,50);
System.out.println("Der Flaecheninhalt des Rechtecks ist " + r1.area());
}
}
class Rectangle
{
Point origin;
int width, height;
int area()
{
return(width*height);
}
}
class Point
{
int x,y;
Point(int xCoord,int yCoord)
{
x = xCoord;
y = yCoord;
}
}
RectangleDemo.java:6: cannot resolve symbol
symbol : constructor Rectangle (Point,int,int)
location: class Rectangle
Rectangle r1 = new Rectangle(p1,40,30);
^
RectangleDemo.java:7: cannot resolve symbol
symbol : method move (int,int)
location: class Rectangle
r1.move(50,50);
^
2 errors
Exit code: 1
There were errors |
|