I am a beginner in bluej programming.I have just typed a progarm of finding area and circumference of a circle but I am getting an error saying "missing method body or declare abstract".Please explain what does it mean and please give me the correction I need to do in my program.Here's my program:
public class circle
{
public void getArea()
{
double radius=2.5;

double area=Math.PI*radius*radius;
double circumference=2*Math.PI*radius;
System.out.println("The area of the circle is "+area);
System.out.println("Its circumference is "+circumference);
}
}

1

Answers

2015-01-01T20:50:13+05:30
You can try this class qwerty { public static void main (String arts[ ]) . . .//declare variables assign values using 3.14 for π ,do simple multiplication then print } } That will work ,unless u have a very outdated version
0
but in the question its given that I have to use pi as it is,that is ,I dont have to convert it into 3.14.So please can u give me the correct code for that