| | #1 |
| Warrior Member Join Date: 2011
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
|
/** * Print to the screen. * * @author Beginner. */ public class Mag { public static void main(String[] args) { double circumference = 2 * Math.PI * radius; System.out.println ("slant height (s): " + circumference); } } I get: Beginner.java:13: error: cannot find symbol double circumference = 2 * Math.PI * radius; ......................................… ^ symbol: variable radius location: class Beginner Please help! Thanks |
| |
| | #2 |
| WordPress Developer War Room Member Join Date: 2009
Posts: 45
Thanks: 3
Thanked 0 Times in 0 Posts
|
The radius variable is not declared. Use this code, Code: /**
* Print to the screen.
*
* @author Beginner.
*/
public class Mag {
public static void main(String[] args) {
int radius = 10;
double circumference = 2 * Math.PI * radius;
System.out.println ("slant height (s): " + circumference);
}
} |
| |
| | #3 |
| Active Warrior Join Date: 2011
Posts: 68
Thanks: 0
Thanked 5 Times in 5 Posts
|
My guess is that you have a problem with your classpath or you path settings.
|
| | |
| |
| | #4 |
| Warrior Member Join Date: 2011
Posts: 25
Thanks: 4
Thanked 0 Times in 0 Posts
|
Its not the classpath Just as handyman suggested, the radius variable is not declared. |
| |
| | #5 |
| Warrior Member Join Date: 2011
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
|
Thanks to all
|
| |
|
| Bookmarks |
| Tags |
| error, find, java, symbol |
| Thread Tools | Search this Thread |
| |