You have a couple of errors.
You seem to be declaring "rectangles" twice.When you get to the print() call, you are printing rectangles rather than a single Rectangle.You are quite correct to assume that the Rectangle object ought to have a toString() method which will alow you to print it out. Please go back to the
Java Tutorial and revise control statements
here. You will find
for somewhere on the left of the window.