|
-
April 8th, 2010, 05:46 PM
#1
Error help on println
Hi, I started studying java on my own a few days back. Anyway, can plase someone tell me what is wrong with this piece of code?:
Code:
public class bananas {
int width =2 , height = 5;
int area = getArea() ;
System.out.println("The area is " + area);
int getArea (){
return (width * height);
}
}
Eclipse says - Syntax error on token "println", = expected after
this token
- Syntax error on token(s), misplaced construct(s)
Thanks for the help
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|