It giving me this error:
circle.java:23: error: cannot find symbol
C1.getData();
^
symbol: method getData()
location: variable C1 of type circle
circle.java:24: error: cannot find symbol
C1.getResult();
^
symbol: method getResult()
location: variable C1 of type circle
2 errors
Here is my source code:
import java.util.*;
class Main {
int r;
double area, circum;
void getData() {
Scanner scan = new Scanner(System.in);
System.out.println("\nEnter Raius of Circle:");
r = scan.nextInt();
}
void getResult() {
area = 3.14 * r * r;
circum = 2 * 3.14 * r;
System.out.println("\n Area of Circle =" + area);
System.out.println("\nCircumference of Circle=" + circum);
}
}
public class circle {
public static void main(String[] args) {
circle C1 = new circle();
C1.getData();
C1.getResult();
}
}