Add the following method to your Rectangle class: public Rectangle union(Rectangle rect) Returns a new Rectangle that

Question:

Add the following method to your Rectangle class:

public Rectangle union(Rectangle rect)

Returns a new Rectangle that represents the area occupied by the tightest bounding box that contains both this Rectangle and the given other Rectangle .

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Related Book For  book-img-for-question
Question Posted: