How can I create a Rectangle object and use its methods to determine the area?
I have tried to create a Rectangle object and print it to console like this:
import java.awt.Rectangle;
public class Rectangle
{
public static void main(String []args)
{
Rectangle box = new Rectangle(5,10,20,30);
System.out.println(box);
}
}
I expected it to print the area but it doesn't. What am I doing wrong?