Finding the samallest yellow rectangle
The minRectangle is doing what it should but could be improved by storing the value of area() in a variable. Assume you have 1.000.000 rectangles to check then the calculation would happen 2.000.000 times.

public static Rectangle minRectangle(Rectangle[] rect) {

    Rectangle min = rect[0];
    double minArea = min.area();

    for (int i = 0; i &lt; rect.length; i++) {
        double currentArea = rect[i].area();
        if (currentArea &lt; minArea) {
            min = rect[i];
            minArea = currentArea; 
        }
    }
    return min;
}




The selectRectangles() method is doing too much work as well. By using an List&lt;Rectangle&gt; to add the rectangles with the desired color and returning the list as array will speed this up.

Please don't omit braces {} although they might be optional. Omitting braces can lead to hidden and therfor hard to track bugs.

public static Rectangle[] selectRectangles(Rectangle[] rect, String color) {
    List&lt;Rectangle&gt; rectangles = new ArrayList&lt;&gt;();
    int countRect = 0;
    for (int i = 0; i &lt; rect.length; i++) {
        if (rect[i].getColor().equals(color)) {
            rectangles.add(rect[i]);
        }
    }

    Rectangle[] results = new Rectangle[rectangles.size()];

    return rectangles.toArray(results);
}




The last task in question isn't solved correctly. You should first get the yellow rectangles in the array and then detect the smallest of these.