0
Why this can't running ?
Class Circle { private int radius; public void setRadius(int radius) { this.radius = radius; } public double area() { return this.radius * this.radius * Math.PI; } } public class Methods { public static void main(String[] args) { Circle c = new Circle(); c.setRadius(5); System.out.println(c.area()); } }
1 Answer
+ 7
class should be spelled with small c.
Change "Class Circle" to "class Circle".