• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint

16.3. Class Rectangle

Like class Point, class Rectangle is used to model an operating system data structure. In this case, it is the normal (x, y, width, height) structure used to mark out a rectangular area of the x-y coordinate plane. Class Rectangle also has a single constructor.

Rectangle(int x, int y, int width, int height) Sets the public fields x, y, width, and height to the provided values.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint