public class Rectangle extends Object
Represents a rectangle with integer pixel coordinates.
| Constructor and Description |
|---|
Rectangle(int x,
int y,
int width,
int height)
Initializes a new instance of the
class. |
| Modifier and Type | Method and Description |
|---|---|
int |
getHeight()
Gets the height of the rectangle.
|
int |
getWidth()
Gets the width of the rectangle.
|
int |
getX()
Gets the x-coordinate of the upper-left corner.
|
int |
getY()
Gets the y-coordinate of the upper-left corner.
|
public Rectangle(int x,
int y,
int width,
int height)
Initializes a new instance of the class.
Rectangle
x - The x-coordinate of the upper-left corner.y - The y-coordinate of the upper-left corner.width - The width of the rectangle.height - The height of the rectangle.public int getHeight()
Gets the height of the rectangle.
public int getWidth()
Gets the width of the rectangle.
public int getX()
Gets the x-coordinate of the upper-left corner.
public int getY()
Gets the y-coordinate of the upper-left corner.
Copyright © 2026. All rights reserved.