Need Help - Basic Java
Can anyone tell me how to get area for the Rectangle?
I know I did something wrong with this code:
I know I did something wrong with this code:
Code:
import java.awt.Rectangle;
public class AreaTester
{
public static void main(String[] args)
{
Rectangle r1 = new Rectangle (10, 20, 30, 50);
r1.getWidth();
r1.getHeight();
double r1.area = width*height;
System.out.println("Area = " + area);
}
}
