Structure inside the structure in Java
Forums:
class Point {
public int x, y;
}
class Size {
public int width, height;
}
class Rect {
public Point point;
public Size size;
}
Rect rect = new Rect();
rect.point = new Point();
rect.point.x = 3;
rect.point.y = 4;
rect.size = new Size();
rect.size.width = 10;
rect.size.height = 12;
- Log in to post comments