Hello

I have had this book for an embarrassingly long time but I finally got round to reading it.

Did exercise 1 for chapter 5, rectangle class (page 267 in my copy), then d/l ans from wrox site

However you have the logic wrong in your Rectangle constructor quoted below...

Code:

public Rectangle(double x1, double y1, double x2, double y2) {
// Ensure topleft uses the smaller of x1,x2 and y1,y2
// and topright uses the larger of x1,x2 and y1,y2
topLeft = new Point(Math.min(x1,x2),Math.min(y1,y2));
bottomRight = new Point(Math.max(x1,x2),Math.max(y1,y2));

Top left is minX maxY

and bottom right is maxX and MinY

I just thought I would let you know, someone might have "given up" when they got it right!