. AWT Rectangle int s. int, , , getter:
int area, width, height;
width = rect.width; // not getWidth()
height = rect.height; // not getHeight()
area = width * height;
getWidth() getHeight() , , , ( int double , a double - , ).
, ( getX() getY()) ? Java 1.2 API . , Rectangle . Java Rectangle int double, , . , , Rectangle2D.Float Rectangle2D.Double, float double .
, , ? Rectangle2D . ( , , ), . , ( , Rectangle2D ). getWidth() getHeight(), double s, .
, , , RectangularShape : Rectangle2D, RoundRectangle2D, Ellipse2D Arc2D. , getWidth() getHeight(), RectangularShape:
RectangularShape something = ......;
System.out.println("The shape (whatever it is) occupies an area of:");
System.out.println(something.getWidth() + " × " + something.getHeight());
, getter ( " " ), , , , / , , .
P.S. Point, int, double getX() double getY() - Point2D.Float Point2D.Double, Point2D.
P.P.S. double ( long) , int s. 32- int, . , , , :
Rectangle big = new Rectangle(0, 0, 1000000, 1000000);
int area = big.width * big.height;
long bigArea = (long)big.width * big.height;
System.out.println(area);
System.out.println(bigArea);