Question: Java CODE ONLY please Q.2. Write a Java class named MyRectangle with four public data members representing the x- and y- coordinates of the bottom-left
Java CODE ONLY please

Q.2. Write a Java class named MyRectangle with four public data members representing the x- and y- coordinates of the bottom-left vertex and top-right vertex of a rectangle, whose sides are parallel to the x- or y-axis. For example, the statement new MyRectangle(20,80,30,90) creates a rectangle with bottom-left vertex at position (20,80), and top-right vertex at (30,90). For this class, (a) Complete the areal) method, which computes the area of a rectangle. (b) Complete the overlap(MyRectangle rect) method. This method returns a rectangle which is the overlapped region of two rectangles. In the event that there is no overlap, it should return a rectangle with both bottom-left vertex and top-right vertex at position (0,0)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
