alexpalmbay
Technical User
I'm new to JAVA, so please handle w/care
I'm trying to write a simple rectangle pgm, but I'm getting the following errors:
Rectangle.java:24: cannot resolve symbol
symbol : variable calculateArea
location: class Rectangle
Sytem.out.println(Rectangle.calculateArea);
Below is my pgm:
/*
* File: Rectangle.java
* Description: This program represents a geometric rectangle.
*/
public class Rectangle
{
private double length = 3; // Instance variables
private double width = 4;
public Rectangle(double l, double w) // Constructor method
{
length = l;
width = w;
}
public double calculateArea() // Access method
{
return length * width; // calculateArea()
}
public static void main(String argv[])
{
System.out.println(Rectangle.calculateArea);
}
}//end of pgm
I'm using jdk1.3.1_04, which I download off the SUN/JAVA website. As I said, I'm new to JAVA, so I'm sure the answer is very simple.
Thank you very much for your help!
I'm trying to write a simple rectangle pgm, but I'm getting the following errors:
Rectangle.java:24: cannot resolve symbol
symbol : variable calculateArea
location: class Rectangle
Sytem.out.println(Rectangle.calculateArea);
Below is my pgm:
/*
* File: Rectangle.java
* Description: This program represents a geometric rectangle.
*/
public class Rectangle
{
private double length = 3; // Instance variables
private double width = 4;
public Rectangle(double l, double w) // Constructor method
{
length = l;
width = w;
}
public double calculateArea() // Access method
{
return length * width; // calculateArea()
}
public static void main(String argv[])
{
System.out.println(Rectangle.calculateArea);
}
}//end of pgm
I'm using jdk1.3.1_04, which I download off the SUN/JAVA website. As I said, I'm new to JAVA, so I'm sure the answer is very simple.
Thank you very much for your help!