level 5
public class Main
{
public static void main(String[] args)
{
Rectangle rect = new Rectangle();
rect.width = 100;
System.out.println(rect.width);
rect.height =200;
System.out.println(rect.height);
Rectangle rect2 = new Rectangle();
rect2.width = 10;
System.out.println(rect2.width);
rect2.height = 20;
System.out.println(rect2.height);
}
}
class Rectangle
{
int width;
int height;
}
2017年06月22日 16点06分
3
level 5
在Rectangle后面再建一个Point类,xy放point里
2017年06月22日 16点06分
5
刚刚尝试不对 不知道那里错了 你能复制上面然后添加进去我看一下? 谢谢🙏
2017年06月22日 16点06分
level 5
public class Main
{
public static void main(String[] args)
{
Rectangle rect = new Rectangle();
rect.width = 100;
System.out.println(rect.width);
rect.height =200;
System.out.println(rect.height);
Rectangle rect2 = new Rectangle();
rect2.width = 10;
System.out.println(rect2.width);
rect2.height = 20;
System.out.println(rect2.height);
}
}
class Rectangle
{
int width;
int height;
}
class Point{
int x;
int y;
}
看题目意思是这样吧应该
2017年06月23日 14点06分
6