Java Error when compiling...
this is my error C:\My Documents\Math.java:6: '{' expected.
public class Math.java {
^
1 error
Tool completed with exit code 1
this is my code:
// Assignment1 Angel Amitrano
// J1 ASSN 1
import javax.swing.JOptionPane; //import class JOptionPane
public class Math.java {
public static void main ( String args [] )
{
String Math.PI// first string entered by user
int diameter
circumference
area
radius
//read in radius from user as a string
radius =
JOptionPane.showInputDialog ( "Enter Radius:" );
//convert numbers from type String to type int
diameter = Integer.parseInt ( diameter );
circumference = Integer.parseInt ( circumference );
area = Integer.ParseInt ( area );
//calculations
diameter = 2 * radius
circumference = 2 * Math.PI * radius
area = Math.PI * radius * 4
//Display the results
JOptionsPane.INFORMATION_MESSAGE(
null, "Diameter is "
null, "Area is "
null, "Circumference is ", "Results",
JOptionPane.PLAIN_MESSAGE );
System.exit(0); //terminate the program
}
}
id"
and this is what its supposed to do:
Write a Java application that inputs the radius of a circle from the user and then displays the circle's diameter, circumference, and area. Use the GUI techniques shown below for input and output. Use the predefined constant Math.PI for the value of . This constant is more precise than using 3.14159. Class Math is defined in the java.lang package, so you do not need to import it.
Use the following formulas (r is the radius):
diameter = 2r
circumference = 2 r
area = r2
I am screwed..can anyone help?

