Java Reference
In-Depth Information
{
private double x, y, width, height;
Double(double x, double y, double width, double
height)
{
this.x = x;
this.y = y;
this.width = width;
this.height = height;
}
double getX() { return x; }
double getY() { return y; }
double getWidth() { return width; }
double getHeight() { return height; }
}
static class Float extends Rectangle
{
private float x, y, width, height;
Float(float x, float y, float width, float height)
{
this.x = x;
this.y = y;
this.width = width;
this.height = height;
}
double getX() { return x; }
double getY() { return y; }
double getWidth() { return width; }
double getHeight() { return height; }
}
// Prevent subclassing. Use the type-specific Double and
Float
// implementation subclass classes to instantiate.
private Rectangle() {}
boolean contains(double x, double y)
{
Search WWH ::




Custom Search