Help-New to Java and I am not getting the error messages when I run java complie
"jenniferplaska" <[email protected]>
| Newsgroups | gmane.comp.java.junit.user |
|---|---|
| Message-ID | <[email protected]> |
All the error are near the bottom--System.out.println---Can someone let me know in simple human language(thank you) how I would correct this? Thank you, jen
/**
* This program demonstrates the Rectangle class's
* setLength, setWidth, getLength, getWidth, getPerimeter,
* getArea methods.
*/
public class RectangleDemo
{
public static void main(String[] args)
{
// Create a Rectangle object.
Rectangle box = new Rectangle();
// Create a Rectangle object.
Rectangle box2 = new Rectangle();
box.setLength(10.0);
box.setWidth(20.0);
area = box.getArea();
perimeter = box.getPerimeter();
box2.setLength(20.0);
box2.setWidth(40.0);
area = box2.getArea();
perimeter = box2.getPerimeter();
}
/**
* The getArea method returns the value
* stored in the Area field.
*/
public double getArea()
{
return length * width;
}
/**
* The getPerimeter method returns the value
* stored in the perimeter field.
*/
public double getPerimeter()
{
return 2 * (length + width);
}
// Display the length, width, area and perimeter.
System.out.println("The box's length is" + box.getLength());
System.out.println("The box's width is" + box.getWidth());
System.out.println("The box's area is" + box.getArea());
System.out.println("The box's perimeter is" + box.getPerimeter());
// Display the length, width, area, and perimeter.
System.out.println("The box's length is "
+ box2.getLength);
System.out.println("The box's width is "
+ box2.getWidth);
System.out.println("The box's area is "
+ box2.getArea);
System.out.println("The box's perimeter is "
+ box2.getPerimeter);
}
------------------------------------
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/junit/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/junit/join
(Yahoo! ID required)
<*> To change settings via email:
[email protected]
[email protected]
<*> To unsubscribe from this group, send an email to:
[email protected]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/