As far as I know (at leant till Java 7) Java doesn't support
nested methods. So you have to write something like:
(please note the entry point should be declared as
main
, all lowercase)
public class CallingMethods {
public static void main(String[] args)
{
Scanner input = new Scanner(System.in);
double diameter;
System.out.print("Enter the radius :");
double radius=input.nextDouble();
double area=calarea(radius);
System.out.println("The are of the circle is " + area);
}
public static double calarea(double radiusC)
{
double CArea;
CArea=PI*radiusC*radiusC;
return CArea;
}
}