この定義をコンパイルしようとしていますが、エラーが発生し続けます。エラーの内容: 1 個のエラーが見つかりました: ファイル: C:\Users\GreatOne\Desktop\Master Folder\04 (j)\04 - Copy\ObjectDemo2\CreateObjectDemo.java [行: 32] エラー: 元を変数に解決できません
/**
* This class offers a main method to create and use sample Point and Rectangle objects.
*/
public class CreateObjectDemo {
public static void main(String[] args) {
// Create a point object and two rectangle objects:
Point origin_one = new Point(23, 94);
Rectangle rect_one = new Rectangle(origin_one, 100, 200);
Rectangle rect_two = new Rectangle(50, 100);
// Display rect_one's width, height, and area:
System.out.printf("Width of rect_one: " , rect_one.width);
System.out.printf("Height of rect_one: " , rect_one.height);
System.out.printf("Area of rect_one: " , rect_one.area());
// Set rect_two's position:
rect_two.origin = origin_one;
// Display rect_two's position:
System.out.printf("X Position of rect_two: " , rect_two.origin.x);
System.out.printf("Y Position of rect_two: " , rect_two.origin.y);
// Move rect_two and display its new position:
rect_two.move(40, 72);
System.out.printf("X Position of rect_two: " , rect_two.origin.x);
System.out.printf("Y Position of rect_two: " , rect_two.origin.y);
}
// A method for moving the rectangle:
public void move(Point newOrigin) {
origin = newOrigin;
}
}
/*